#ifndef WORKB_H #define WORKB_H #include #include using namespace std; class test { private: string id; //id int age; string phone; public: test() { //构造函数 id = string("empty id"); age = 21; phone = string("15185626392"); } test(string id, int age, string phone) { //构造函数 this->id = id; this->age = age; this->phone = phone; } ~test() { //析构函数 } void Print() { //输出函数 cout << "id是:"; cout << id << endl; cout << "age是:"; cout << age << endl; cout << "phone是:"; cout << phone << endl; } }; #endif