lundi 25 avril 2022

Issues with declaring enum

I'm getting an error when trying to declare an enum. It says the identifier is undefined, but I am including the applicable file where it was defined. (This is my first coding class so sorry in advance). Where am I going wrong? And how do I pass the enum to a constructor?

// 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;
};

#endif

Aucun commentaire:

Enregistrer un commentaire