emptying of rewriting ostringstream convert

Hello,
i was trying to change an int to string. it is working well but there is another problem in the output

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  
deck::deck(){

	int i=0;
	ostringstream convert1;

	while(i<12){
		convert1<<i+2;
		if(i!=8 && i!=9 && i!=10 && i!=11){
			deck::Deck[i].face=convert1.str();
		else {
		
			if (i==8){
			
				deck::Deck[i].face="J";
			}
			if (i==9){
			
				deck::Deck[i].face="Q";
			}
			if (i==10){
			
				deck::Deck[i].face="K";
			}
			if (i==11){
			
				deck::Deck[i].face="A";
			}
		}
		//code to empty convert1 or rewrite 
		deck::Deck[i].s.color="Red";
		deck::Deck[i].s.Suits="Diamond";
		deck::Deck[i].value=i+2;
		deck::Deck[i].point=0;
		i++;
	}



this is the output

2
23
234
2345
23456
234567
2345678
23456789
J
Q
K
A


how can i clear or rewrite the previously converted element? if i can't how can i convert from integer to string without using this method?
Thank you :)
Due to the stream nature of convert1 it will append all subsequent numbers.
To solve that move line 5 between line 7 and 8.
It worked. Thank you a lot :D
Topic archived. No new replies allowed.