hello! what is the best way to clear an array so that i can fill it with new values?
hello! what is the best way to clear an array so that i can fill it with new values?
what kind of arrays are we talking , Multidimensional, dynamic?
Why would you be clearing it? Just overwrite the present values.
Code:memset(array,0,sizeof(array));
Peter O. Programming tips
>>memset(array,0,sizeof(array));
and one good reason not to do it that way would be this . (depending of course, on the contents of the array)
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]