📄 prog10_02.cpp
字号:
// Program 10.2 Using a namespace File: prog10_02.cpp
#include <iostream>
#include <string>
namespace data {
extern const double pi; // Variable is defined in another file
extern const std::string days[]; // Array is defined in another file
}
int main() {
std::cout << std::endl
<< "pi has the value "
<< data::pi << std::endl;
std::cout << "The second day of the week is "
<< data::days[1] << std::endl;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -