the_shoeless_shoe
|
I have a struct name "spell", where it contains data for, well, spells.
Then I have this function that wants to receive a spell so that it can do stuff with it.
int prepareFrame(int nbreFrame, int Source, spell Dest);
But the compiler says "invalid argument type 'spell' "
So I guess I can't do it this way, heh. But is there a way to pass a struct like that, you know, serializing it or what not, or I am stuck to pass everything inside "spell" one at a time?
Thanks!
Posted on 2005-12-27 02:24:05
|
Kildorf
|
The best way to get around this problem is to pass an array index instead. I assume you have a global array of spells (since you can only have global arrays), so instead of passing the spell struct through, you could just pass the index of the spell in the global array.
Hopefully that helps. Good luck!
Posted on 2005-12-27 05:19:46
|