#include "stdafx.h" #include <iostream> using namespace std; int a=10; [B] void[/B] main() { a=20; cout<<a<<endl; cout<<::a<<endl; }
BTW just as a reminder, main (void)
doesnt return void
, it returns an int
which is the signal to the operating system about the execution status of the program. A zero is returned on flawless execution while a non-zero return implies there was some problem faced while executing the code.
Hope it helped, bye.