1. Insert into slot: which inserts the element into the specific position in the array and shifts the following elements including the one that was in the position that I want to insert the element into down along the array.
2. Remove slot from arrayl This basically removes a elemeny from an array and shifts the elements following up along the array.
EDIT: Oh and I'll be using resizable arrays too using the method gleeok shared.
CODE
//suppose you need 100 to 1000 blocks.
int arrayX[1024]; //round it up
int arrayXsize = 0; //keep track of the true size here
...
for(int i;i < arrayXsize; ++i)
{
if(arrayX[i] == 0)
arrayXsize--; // or whatever
}
int arrayX[1024]; //round it up
int arrayXsize = 0; //keep track of the true size here
...
for(int i;i < arrayXsize; ++i)
{
if(arrayX[i] == 0)
arrayXsize--; // or whatever
}
Edited by blackbishop89, 16 July 2011 - 11:28 AM.