Originally Posted by
ItsAaron
Is there anyway i can switch curplay over to play2 at the end of my code?
Yeah, you have to use a global variable instead of a define. Of course, then you can't use it to substitute for a different variable name (the struct).
The reason you can use a #define to do that is the same reason it CANNOT be changed. #defines are "preprocessor" events. Before the code is compiled, the preprocessor goes through it and literally replaces all instances of the define label with it's definition. So when the code is compiled, "curplay" has been replaced with curplay1. So your code would look like:
Code:
if (play1==play1) play1=play2;
Nb. you also used = instead of ==.
That will work if play1 and play2 are pointers to structs, but it will not work if they are actually structs.
Really, you should just be using a global pointer (and not a define) for this, as laserlight says.