📄 ex0218.cpp
字号:
// Programming with C++, Second Edition, by John R. Hubbard
// Copyright McGraw-Hill, 1999
// Example 2.18 on page 31
// Scope of Variables
#include <iostream>
using namespace std;
int main()
{ // illustrates the scope of variables:
x = 11; // ERROR: this is not in the scope of x
int x;
{ x = 22; // OK: this is in the scope of x
y = 33; // ERROR: this is not in the scope of y
int y;
x = 44; // OK: this is in the scope of x
y = 55; // OK: this is in the scope of y
}
x = 66; // OK: this is in the scope of x
y = 77; // ERROR: this is not in the scope of y
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -