方法1:
类的头文件中写
#pragma once class MyTeacher { public: MyTeacher(); ~MyTeacher(); };
方法2:
类的头文件中写
#ifndef _MYTEACHER_H_ #define _MYTEACHER_H_ class MyTeacher { public: MyTeacher(); ~MyTeacher(); }; #endif
2023-11-25 12:43:10
方法1:
类的头文件中写
#pragma once class MyTeacher { public: MyTeacher(); ~MyTeacher(); };
方法2:
类的头文件中写
#ifndef _MYTEACHER_H_ #define _MYTEACHER_H_ class MyTeacher { public: MyTeacher(); ~MyTeacher(); }; #endif