Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope #34

Open
billcollis opened this issue Apr 23, 2017 · 0 comments
Open

Scope #34

billcollis opened this issue Apr 23, 2017 · 0 comments
Assignees

Comments

@billcollis
Copy link

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

@felixhao28 felixhao28 self-assigned this Apr 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants