item.h
来自「通讯录系统」· C头文件 代码 · 共 30 行
H
30 行
//Item.h
#ifndef ITEM_H
#define ITEM_H
#include <string>
//Item类
class Item {
std::string name; //姓名
std::string telNum; //电话号码
public:
//构造函数
Item();
Item(std::string newName, std::string newTelNum): name(newName), telNum(newTelNum){}
//GET函数
std::string getName() {
return name;
}
std::string getTelNum() {
return telNum;
}
//SET函数
void setName(std::string n) {
name = n;
}
void setTelNum(std::string t) {
telNum = t;
}
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?