datatype.hpp

来自「用C++编写的通讯录,好用,是大一时的课程设计!运行通过,绝对正确」· HPP 代码 · 共 40 行

HPP
40
字号
#include <iostream>
using namespace std;

static char id[3][10] = {"家庭成员", "朋友", "同事"};                           // 定义 属性元素 实含义

class addressType                                                               // 地址类
 {
  public:
	char street[50], city[30], provice[30], postcode[15];
 };


class personType                                                                // 人员基本属性类 
 {
  public:
    char fn[30], ln[30], sex[10], birthday[20];
 };


class extpersonType : public personType, public addressType                     // 扩展任务属性类 
 {
  public:
    int att;
    char tel[30];

    void out()
     {
      cout << "姓:" << fn << endl;
	  cout << "名:" << ln << endl;
	  cout << "性别:" << sex << endl;
	  cout << "生日:" << birthday << endl;
      cout << "街道:" << street << endl;
      cout << "城市:" << city << endl;
	  cout << "省份:" << provice << endl;
	  cout << "邮编:" << postcode << endl;
   	  cout << "身份:" << id[att] << endl;
	  cout << "电话号码:" << tel << endl;
	 }
 };

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?