JSCPP icon indicating copy to clipboard operation
JSCPP copied to clipboard

Scope

Open billcollis opened this issue 8 years ago • 0 comments

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? }

billcollis avatar Apr 23 '17 18:04 billcollis