Struct inside a struct

Status
Not open for further replies.
Structs in vJASS are more like Java objects than C structs. All struct type variables are pointers to a struct instance.

JASS:
a[0].b = a[1]
What this does is set the member b of the struct pointed at by index 0 of a to the struct pointed at by index 1 of a. This is bad behaviour because you never assign index 0 of a to a valid struct so you are modifying unallocated struct space.

The rest of the code makes even less sense. You forgot to modify i somewhere.
 
Status
Not open for further replies.
Back
Top