I cannot have a struct as an argument in my function? ;_;
Displaying 1-2 of 2 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
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


Displaying 1-2 of 2 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.