📄 main.cpp
字号:
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
namespace Work {
int FavoriteNumber;
class Info {
public:
string CompanyName;
string Position;
};
void DoStuff() {
cout << "Doing some work!" << endl;
}
}
namespace Play {
int FavoriteNumber;
class Info {
public:
string FullName;
string Hobby;
};
void DoStuff() {
cout << "Having fun!" << endl;
}
}
int main(int argc, char *argv[])
{
// Work stuff
Work::FavoriteNumber = 7;
Work::Info WorkInformation;
WorkInformation.CompanyName = "Spaceley Sprockets";
WorkInformation.Position = "Worker";
Work::DoStuff();
// Play stuff
Play::FavoriteNumber = 13;
Play::Info PlayInformation;
PlayInformation.FullName = "George Jetson";
PlayInformation.Hobby = "Playing with the dog";
Play::DoStuff();
system("PAUSE");
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -