 <p>The keyword <code>static</code> unfortunately has a few different unrelated meanings in C++</p> <ol> <li><p>When used for data members it means that the data is <strong>allocated in the class</strong> and not in instances.</p></li> <li><p>When used for data inside a function it means that the data is allocated statically, <strong>initialized the first time the block is entered</strong> and lasts until the program quits. Also the variable is visible only inside the function. This special feature of local statics is often used to implement lazy construction of singletons.</p></li> <li><p>When used at a compilation unit level (module) it means that the variable is like a global (i.e. allocated and initialized before <code>main</code> is run and destroyed after <code>main</code> exits) but that <strong>the variable will not be accessible or visible in other compilation units</strong>.</p></li> </ol> <p>I added some emphasis on the part that is most important for each use. Use (3) is somewhat discouraged in favor of unnamed namespaces that also allows for un-exported class declarations.</p> <p>In your code the <code>static</code> keyword is used with the meaning number 2 and has nothing to do with classes or instances... it's a variable of the <strong>function</strong> and there will be only one copy of it.</p> <p>As correctly <strong>iammilind</strong> said however there could have been multiple instances of that variable if the function was a template function (because in that case indeed the function itself can be present in many different copies in the program). Even in that case of course classes and instances are irrelevant... see following example:</p> <pre><code>#include &lt;stdio.h&gt; template&lt;int num&gt; void bar() { static int baz; printf("bar&lt;%i&gt;::baz = %i\n", num, baz++); } int main() { bar&lt;1&gt;(); // Output will be 0 bar&lt;2&gt;(); // Output will be 0 bar&lt;3&gt;(); // Output will be 0 bar&lt;1&gt;(); // Output will be 1 bar&lt;2&gt;(); // Output will be 1 bar&lt;3&gt;(); // Output will be 1 bar&lt;1&gt;(); // Output will be 2 bar&lt;2&gt;(); // Output will be 2 bar&lt;3&gt;(); // Output will be 2 return 0; } </code></pre>