typedef struct {
unsigned short int Position; // << That's what i'm trying to change!
unsigned short int OldPosition;
} Turn_s;
struct Turn_sMap{
Turn_s *Turn;
Turn_sMap *NextTurn;
};
New = new Turn_sMap;
New->Turn = new Turn_s;
New->Turn.Position = 0; // Already tried (New->Turn).Position = 0;
Why I get that compile error? Am i not accessing the struct Turn inside the struct New, which in turn has a member called Position? Or does typedef messes the struct type with some pointer craziness?? Help please, I’m lost! ):
The declaration
Turn_s *Turn;makesTurna pointer type. To access member objects you need to use->operator. Try: