Enum difficulty
I'm trying to create a Turtle for an OpenGL project. My professor recommended using this in the class:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
enum Pen_States {UP, DOWN};
struct Turtle_State
{
float x,y,angle;
};
struct Turtle_Info
{
Turtle_State Current_State;
Pen_States Pen;
int Pen_Color;
};
Turtle_State TS;
Turtle_Info TI;
|
When I move on to the implementation file, however, when I try to use this:
if(CP.TI.Pen == UP) //CP is a Turtle object
It gives an error saying that UP is undefined. What am I doing wrong?
Is Pen_States inside a namespace (other than the one your implementation is in)?
Topic archived. No new replies allowed.