Possible Duplicate:
How to clear stringstream?
I have this c++ command
//siteurl and filename are of string type
stringstream ss;
ss << "lynx -dump '" << siteurl << "' > " << filename;
On first loop, everything ok. But on second loop i realize it just append instead of create a new record
as i troubleshoot using cout it give me this, I realize the command is append instead of overwrite on 2nd loop, how do I null or reset or overwrite first record of ss (stringstream) on 2nd loop/usage.
Webparser: lynx -dump 'http://sg.finance.yahoo.com/q?s=USDSGD=X' > file.txtlynx -dump 'http://sg.finance.yahoo.com/q?s=EURUSD=X' > file.txt
What i want is on 2nd loop it will be this output
Webparser: lynx -dump 'http://sg.finance.yahoo.com/q?s=EURUSD=X' > file.txt
I am new to C++, thanks for all help, greatly apperciated.