Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ByteMe95

how to clear a stringstream object in stl????

This topic is 5858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ive looked to the vast reaches of the itnernet and from what I have seen there is practically absolutely no way to clear a stringstream object!!! How is that possible? Say i have a stringstream object A, and i use it in a loop. At the beginning of every loop I want to clear A so it doesnt accumulate when I extract the string wtih A.str() FRom what ive seen there is no way to clear the buffer, the only solution i have come up wtih is to declare A as a pointer and do A = new stringstream; before the use and delete A after the use is there no better way? ByteMe95::~ByteMe95() My S(h)ite

Share this post


Link to post
Share on other sites
Advertisement
Umm. I might be wrong but are you allowed to:


stringstream ss;
//fill ss with junk
ss = "";


Then again maybe I''m out to lunch on this one...

Share this post


Link to post
Share on other sites
Maybe try
ZeroMemory(stringObj, sizeof(StringStream))
This may work, or it may casuse your computer to freeze, I don''t know, use at your own risk.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!