This is a general programming question; I think it is much suited here.
Is there a way to append an object/pointer to an array, without keeping a counter? Like in the Ruby Programming Language you can use "<<" to append an object to the first unoccupied space in an array.