+ 3
CAN SOMEONE EXPLAIN TO ME THIS?
#include <iostream> using namespace std; int x; int main() { int x; cout<<"global x is "<<::x<<endl; cout<<"local x is "<<x<<endl; return 0; } //why global x is 0 and local x is the garbagy thing?
1 Resposta
#include <iostream> using namespace std; int x; int main() { int x; cout<<"global x is "<<::x<<endl; cout<<"local x is "<<x<<endl; return 0; } //why global x is 0 and local x is the garbagy thing?