06-10-2008 02:54 PM - edited 06-10-2008 02:54 PM
You should really consider doing the operations "in place" especially since you know the final array size.
Here is an example that would initialize an array of the final size and then replace elements with new data as they arrive.
It will be MUCH more gentle on memory management. Trust me!
Modify as needed (there could be bugs.)

06-11-2008 04:34 AM
GerdW is right, the '0' at the add function must be replaced by the shift register. And as Altenbach mentioned, your application is the ideal example of applying inplaceness since you know the exact size of the array.
KostasB
NIUK Applications Engineering
06-11-2008 06:41 AM