| |
GeekInterview.com > Interview Questions > Concepts > OOPS
| Print | |
Question: Scope resolution
Answer: What is scope resolution in C++ and object oriented ? |
| February 02, 2009 20:55:17 |
#1 |
| Gothic |
Member Since: February 2009 Total Comments: 2 |
RE: Scope resolution |
#include using namespace std;
int amount = 123;
// A global variable int
main()
{
int amount = 456;
// A local variable
cout << ::amount << endl
// Print the global variable with Scope
Reso << amount << endl;
// Print the local variable
} |
| |
Back To Question | |