Hi guys,

I have this chunk of code:
Qt Code:
  1. ...
  2. int x = 10; // global
  3.  
  4. void main() {
  5. int x = 20; (line A)
  6. {
  7. int x = 30;
  8. // How to read the value of x from the line A in this scope?
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 
The question is in the code: How to read the value of x from the line A in this scope?
Qt Code:
  1. cout << x ; // gives 30;
  2. cout<<::x; // give 10;
To copy to clipboard, switch view to plain text mode 
Thanks for any help

Kacper