析构函数
在类名前面加上~
typedef int DataType;
class SeqList
{
public:
seqlist
定义一个C++的类
//定义一个C++的类:和结构体的定义方式一样
struct Student
{
void SetStudenInfo(const char* name, const char* gender, int age)
{
strcpy(_name, name);
strcpy(_gender, gender);
_age = age;
}
void PrintStudentInfo()
{
cout << _name << "" << _gender << "" << _age << endl;
}
char _name[20];
char _gender[3];
int _age;
};
C++中常用的定义类的方式
class 类名{所有的成员};