GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  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