maverick_pol
13th April 2008, 23:01
Hi guys,
I have this chunk of code:
...
int x = 10; // global
void main() {
int x = 20; (line A)
{
int x = 30;
// How to read the value of x from the line A in this scope?
}
}
The question is in the code: How to read the value of x from the line A in this scope?
cout << x ; // gives 30;
cout<<::x; // give 10;
Thanks for any help :)
Kacper
I have this chunk of code:
...
int x = 10; // global
void main() {
int x = 20; (line A)
{
int x = 30;
// How to read the value of x from the line A in this scope?
}
}
The question is in the code: How to read the value of x from the line A in this scope?
cout << x ; // gives 30;
cout<<::x; // give 10;
Thanks for any help :)
Kacper