I got the following problem:
When I use this code
#include <iostream>
int count = 10; /* Global variable */
int main() {
while(count--) {
}
return 0;
}
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!