summaryrefslogtreecommitdiff
path: root/c,cc/reuse_stringstream.cc
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-09-06 22:32:49 +0100
committerPatrick Simianer <p@simianer.de>2014-09-06 22:32:49 +0100
commit626c2cd921e7442c20ac1be7be0b9ecb44d00c95 (patch)
treed9bb1d4c670ffc3e6094202dc2d5764040c4c1ff /c,cc/reuse_stringstream.cc
parent01215a3f542df6692ef12b4e4b5fed551d065545 (diff)
cc examples
Diffstat (limited to 'c,cc/reuse_stringstream.cc')
-rw-r--r--c,cc/reuse_stringstream.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/c,cc/reuse_stringstream.cc b/c,cc/reuse_stringstream.cc
new file mode 100644
index 0000000..f214544
--- /dev/null
+++ b/c,cc/reuse_stringstream.cc
@@ -0,0 +1,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;
+}
+