I am trying the following but I think its not getting to the last, item or something, can someone have a look and see if im right for the shifting of the array (red bit):
Code:
int smallItems=0;
for(listi=0; listi<numOfItems; listi++)
{
for (j=0;j<height;j++)
{
for (i=0;i<width;i++)
{
if(array2[j][i] == objects[listi])
{
smallItems++;
}
}
}
if(smallItems < 525)
{
for (j=0;j<height;j++)
{
for (i=0;i<width;i++)
{
if(array2[j][i] == objects[listi])
array2[j][i] = 0;
}
}
for(i=listi; i<numOfItems-1; i++)
{
objects[listi] = objects[listi+1];
}
listi--;
numOfItems--;
}
printf("SmallItems: %d, listi: %d\n", smallItems, listi);
smallItems = 0;
}