I'd suggest 2 things:
1. If you plan to use multiple arrays, create an array of arrays, and pass the index of the array within this meta-array.
2. Save array length in an additional variable after each add/remove element operation. It may be convenient to use structures, to store array and length variable within one variable. Or, if your array's type is int, you can use array[0] to store its length.
Or, if you're 100% sure what value empty element has, you can create your length() function, which would search for index of the last not empty element.
Last edited Jan 03, 2013 by Zolden
LitePollution9 Regular ShmoeI need to pass an array as a parameter into a function, now before you start telling "but you cant...."
Does Galaxy+ + editor make use of the * reference operator so that if I executed the function by script, I could theoretically pass the pointer leading back to the array into the function.
Also, I need to calculate the length of an array. I know the number of indexes / keys does not change - is there a pre-existing .length() sizeof() , etc... C + + function that I can use without hacking the editor.
Alien Boombox - The Free Online Music Player Web App
Alien Boombox - Skinnable Music Player Screenshots