I'm trying to create and zero an array of int
s based on a size that I get at runtime:
size = [gamePiece.availableMoves.moves count]; //debugger shows size = 1;
int array[size]; //debugger shows this as int[0] !
memset(array, 0, size);
indexes = array;
size
and indexes
are both ivars of this class:
int size;
int* indexes;
I end up with a 0-length array, though. How can I create it with the size indicated by [gamePiece.availableMoves.moves count]
?