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