
May 8th, 2003, 09:57 AM
|
 |
Contributing User
|
|
Join Date: Jan 2003
Location: USA
|
|
Two ways immediately come to mind.
To write over all the elements of the array with a NULL (value of zero), you could either use a loop or use memset:
Code:
memset(test, 0, 10);
Or, if you just want to make it an empty string:
In this second case, it doesn't matter that the previous characters are still in the array, because the string ends at the NULL.
|