summaryrefslogtreecommitdiff
path: root/c,cc/reuse_stringstream.cc
blob: f21454410e9e1c9c2303110c8f3d36900d9b2612 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <sstream>
#include <string>
#include <iostream>

using namespace std;

int
main(void)
{
  ostringstream ss;
  for (int i = 0; i < 5; i++) {
    ss.str(string()); 
    ss << "asdf";
    ss << i;
    ss << i;
    ss << i;
    ss << i;
    cout << ss.str() << endl;
  }

  return 0;
}