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:
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:
Post a Comment