Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: mnashadkaPosted on 2003-04-15 at 20:31:27ID: 8338294
If by string you mean char *, you can either memset it back to 0 (memset(mystring, 0, mystring_length);) or just strcpy the empty string back into it (strcpy(mystring, "");). Keep in mind that the strcpy will reset the first couple of characters, but if there are any characters past the null terminator they may not be overwritten. The first way (memset) will reset the whole thing, which is probably a safer bet depending upon what you're actually doing.
If you mean string (which would be C++), just set it equal to "" (e.g. str = "";).
Good luck!