Help!! Remove zeros from array

 

What's the best away to remove zeros (or any value for that matter) from a 1-dimensional array so that all the other data shifts down?


For example, lets say I have the array:

double array1[5] = {0,5,0,3,4};


and what I want to end up with is:

{5,3,4} so that the new ArraySize is 3 and all the zeros are gone (i.e. the other values all shifted over once the zero was 'removed')?


Thanks in advance!