Monday, January 16, 2012

Scope Resolution Operator (::)

#include "stdafx.h"
#include <iostream>

using namespace std;

//define Global variable
int i = 10;

int _tmain(int argc, _TCHAR* argv[])
{
 //define variable inside function main()
 int i = 5;


 cout << "i : " << i << endl;
 cout << "::i : " << ::i << endl;

 system("PAUSE");
 return 0;
}


Using of Scope Resolution Operator (::)

No comments:

Post a Comment