#test.chsh#

来自「一个类c++语言解释器」· CHSH# 代码 · 共 38 行

CHSH#
38
字号
int x; // global xint main(){ int i;    cout<<"Please input i:";  cin>>i;  x = 99; // global x is 99  if(i == 4) {    int x; // local x    int num; // local to if statement    x = i * 2;    cout << "Outer local x before loop: "         << x << "\n";    while(x--) {      int x; // another local x      x = 18;      cout << "Inner local x: " << x << "\n";    }    cout << "Outer local x after loop: "         << x << "\n";  }  // Can't refer to num here because it is local  // to the preceding if block.//  num = 10;  cout << "Global x: " << x << "\n";}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?