Reset Array to zeros

Hi Guys,

I have an array of 1500 elements that gets gradually filled with code before eventually being written to SD card. Unfortunately the 1500 is intentionally too large as i only expect around 1300 events to fill the array (inderterminate amount between 1250 and 1350).

What i need to do is set the array to all zeros after the write to SD such that when it gets filled again if less elements than last time get filled then when it writes out the array i get the last few results from the previous enrties.

So i know i could loop through the array and set each element to zero but that seems inefficient. Can anyone suggest a way to blank the array please?



You don't need to blank the whole array :wink:

Overwrite the old data then when it's time to write to SD, fill whatever is left with 0 just before the write.

Or, remember how many elements were used last time, if the new amount of data to be written is less than the previous, fill with 0 to the previous element number, if more, do nothing, simples. At most you will only ever clear 100 elements.

Thanks Guys