Scope
billcollis opened this issue · comments
Bill Collis commented
I tried the following and it works, but m should not be in scope
#include
using namespace std;
int g=1;
int main() {
int m = 2;
cout << "scope test" << endl;
func1();
return 0;
}
void func1(){
int f1 = 10;
cout << g << endl;
cout << f1 << endl;
cout << m << endl; //should not be in scope but is?
}