📄 c01-file1
字号:
//File1.cpp文件的源代码
#include <iostream>
#include "File1.h"
//汇入名字空间中的声明
using namespace std;
using namespace namespaceFile1;
//实现Dog类的成员函数
void Dog::Bite() const
{
cout<<"A dog is Biting something!"<<endl;
}
void Dog::Sleep() const
{
cout<<"A dog is Sleeping!"<<endl;
}
//入口函数(主函数) main
int main()
{
Dog adog(5);
adog.Sleep();
cout<<adog.GetAge()<<endl;
adog.AddAge(3);
cout<<adog.GetAge()<<endl;
cout<<"The end of this program!\n";
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -