I'm just learning structures, and I'm having some trouble. The following is the structure I delcared globally:
and the next is when I declare members of the structure in my main function:Code:struct creatures { int *position; };
Now, if you need to know more I can post more code, but I don't think it's necessary. Basically, my program runs perfectly fine. Only, if I so much as declare the second member (struct creatures pred), the program crashes on startup. If I comment out that line, everything works as intended again. Wtf? I'm not even doing anything with it yet! Any help would be greatly appreciated.Code:char command; struct creatures prey1; struct creatures pred;



LinkBack URL
About LinkBacks



