Possible Duplicate:
Any shortcut to initialize all array elements to zero?
How to Initializing a normal 2D array with zeros(all shells should have zero stored) without using that old looping method that takes lots of time .My code wants something that should take very less time but via looping method my time limit exceeds.
The important thing to realise here is that if you’re storing primitives then the default value is zero (scroll down to the Default Values section). This applies to array initialisation as well as simple variable initialisation, and consequently you don’t have to initialise the array contents explicitly to zero.
If you have to reset an existing structure, however, then you’d have to loop through the structure, and you may be better off initialising a new instance of your array structure.
Note that if you’re creating an array or arrays, obviously you have to initialise the first array with the contained array.