C++: using namespace, global variable won't work : <p>I got the following problem: </p>

<p>When I use this code</p>

<pre><code>#include &lt;iostream&gt;

int count = 10; /* Global variable */

int main() {
   while(count--) {

   }
   return 0;
}
</code></pre>

<p>the code compiles perfectly well. However, if I add "using namespace std;" then I get the error message "count undeclared" in the while-loop. The same is also true if I add "static" before "int count". I am new to C++ so I have not fully understood scopes etc. Can somebody explain? Thanks in advance!</p>
