Wednesday, June 24, 2009

Global variables can be accessed even if a local variables have the same name



NOTE : -
THIS CONTENT IS NOT ORIGINAL

7. Global variables can be accessed even if a local variables have the same name

A global variable can be accessed even if another variable with the same name has been declared inside the function:


using namespace std;
#include

double a = 128;

int main ()
{
double a = 256;

cout << "Local a: " << a << endl;
cout << "Global a: " << ::a << endl;

return 0;
}


Output
Local a: 256
Global a: 128



BIBILOGRAPHY / REFERENCE : - http://www.4p8.com/eric.brasseur/cppcen.html

No comments:

3G S

JAIL BREAK

iPHONE

BILL GATES

StEvE JoBs

steve jobs

STEVE JOBS

Steve Jobs

Love Country

SD

Burroughs

Lift

Joseph Johnson

Apple Rainbow

Apple Blue

Apple Laser Printer