Why is it that in the second cout stmt of the main function, ::abc is printed out as 11? Doesn't :: refer back to the global variable which in this case is 10?
Is this the correct understanding? Please correct me if I'm wrong.
Also, in the function fn, ::abc = abc; changes the global variable as well? So functions can change global variables? Is this the correct understanding?
Why is it that in the second cout stmt of the main function, ::abc is printed out as 11? Doesn't :: refer back to the global variable which in this case is 10?
The global variable abc is 11 it is incremented on line 15.
Oh, ok! I thought that the variable abc was incremented only in the main function and global was unchanged.
But now I see, that main has been manipulating the global variable UNTIL we officially declared int abc = 5 on line 16. Hopefully this is the right reasoning. If not please correct.