1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 // strstream(char* s, int n, ios_base::openmode mode = ios_base::in | ios_base::out);
23 char buf[] = "123 4.5 dog";
24 std::strstream inout(buf, 0);
25 assert(inout.str() == std::string("123 4.5 dog"));
32 inout << i << ' ' << d << ' ' << s;
33 assert(inout.str() == std::string("321 5.5 cat"));
43 char buf[23] = "123 4.5 dog";
44 std::strstream inout(buf, 11, std::ios::app);
45 assert(inout.str() == std::string("123 4.5 dog"));
57 inout << i << ' ' << d << ' ' << s;
58 assert(inout.str() == std::string("123 4.5 dog321 5.5 cat"));