标签:
#include<iostream> int a = 10; int main() { int i = 10; std::cout<<"a = "<< a<<", i = " << i <<std::endl; int a = 20; //局部变量取代全局变量 std::cout<<"a = "<< a<<", i = " << i <<std::endl; std::cout<<"a = "<< ::a<<", i = " << i <<std::endl; return 0; } 输出结果:a = 10,i = 10; a = 20,i = 10; a= 10,i = 10;
标签:
原文地址:http://www.cnblogs.com/Charles-Wang/p/4585151.html