类的定义格式-C++程序设计(谭浩强完整版)

类的定义格式: class类名{ private :成员数据;成员函数; public :成员数据;成员函数; protected:成员数据;成员函数; };关键字类名私有公有保护class Student { private : char Name[20]; float Math; float Chiese; public : float average; void SetName(char *name); void SetMath(float math); void SetChinese(float ch); float GetAverage(void); };分号不能少
ppt 文件大小:8.66MB