How do you clear array values (or the entire array) so they're empty?
How do you clear array values (or the entire array) so they're empty?
If you're talking about an setting an array of integers so that each element equals 0...then you could use a For Loop, going from 0 to (N - 1), where N is the number of elements, and within the For Loop you can set Element[N] = 0.
What do you mean by empty?
Pentium 4 - 2.0GHz, 512MB RAM
NVIDIA GeForce4 MX 440
WinXP
Visual Studio .Net 2003
DX9 October 2004 Update (R.I.P. VC++ 6.0 Compatability)
Empty as in no value, it's for a char and an int array, so I can write over it with a smaller string, but not have the end of the old one print out.
You can use memset for char or int arrays, but if you're using C++ you should be using strings or vectors which have clear() methods.
would setting all of their values to 0 not be good enough?