?? p1-31.cpp
字號:
#include<iostream.h>
float x=365.5; //聲明全局變量
main() {
int x=1,y=2;
double w=x+y;
{
double x=1.414,y=1.732,z=3.14;
cout<<"inner:x="<<x<<endl;
cout<<"inner:y="<<y<<endl;
cout<<"inner:z="<<z<<endl;
cout<<"outer:w="<<w<<endl;
cout<<"::x="<<::x<<endl; //訪問重名的全局變量
}
cout<<"outer:x="<<x<<endl;
cout<<"outer:y="<<y<<endl;
cout<<"outer:w="<<w<<endl;
//cout<<"inner:z="<<z<<endl;無效
cout<<"::x="<<::x<<endl; //訪問重名的全局變量
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -