Assign the first element a '\0'. If you're a masochist, use memset on the whole char array.
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
not working
post code. or not helping.
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
char array="food";
You can use delete[]array to clear the memory
hinduengg
Junior Poster in Training
88 posts since Jun 2007
Reputation Points: 36
Solved Threads: 4
No you can't. You can only 'delete' or 'free' dynamically allocated memory. Plus the above statement won't compile. Go figure.
And please see the date of the previous post before posting in a thread. This thread is 3 years old.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734