我在试图声明一个枚举时出错了。它说标识符是未定义的,但我包括定义它的适用文件。(这是我的第一节编码课,很抱歉)。我哪里出问题了?以及如何将枚举传递给构造函数?
// in degree.h file
#ifndef Student_h
#define Student_h
#pragma once
enum class DegreeProgram { program1, program2, program3 };
#endif
// in student.h file
#ifndef Student_h
#define Student_h
#pragma once
#include "degree.h"
class Student {
private:
   DegreeProgram program;
};
#endifhttps://stackoverflow.com/questions/72008033
复制相似问题