tags:

views:

153

answers:

2

I am trying to convert int to string and after that merge string with the new string from int. Like it is done in this example a_http://www.cplusplus.com/forum/beginner/1057/

Any hints what did i mess up?

http://img571.imageshack.us/img571/6027/001kb.jpg

+2  A: 

You didn't clear the stringstream between loops.

DeadMG
A: 

i managed to get it working but after each loop i cant seem to get number content deleted. tried number = NULL; number.clear(); number.flush(); number = "\0"; number = "\n"

tried adding these just after the loop starts. 1st command and after it follows number << i;

kurrata
output is like thisunit_0 unit_01 unit_012
kurrata
You should just make a new stringstream each loop. You don't need it afterwards for anything.
DeadMG