I have two classes: MazeClass and CreatureClass, that use a struct called "coordinates," how am I able to use the struct across both classes?
I’ve tried to put the struct in twice and I get:
MazeClass.h:16:8: error: redefinition of ‘struct coordinate’
CreatureClass.h:11:18: error: previous definition of ‘struct coordinate’
You can declare the struct in one of the classes in public. Choose the class that is more relevant:
Other classes can access this type as
MazeClass::coordinate. Alternatively you can bring it with a typedef.