Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
wstringstream.cpp
Go to the documentation of this file.
1
29#include <iostream> // for wcout
30#include <sstream> // for wstringstream
31
32#include <examples.h>
33
34
35int main ()
36{
37 // create a bi-directional wstringstream object
38 std::wstringstream inout;
39
40 // write out three lines to the stream
41 inout << "Dieses ist die Geschichte eines Mannes.\n"
42 << "C'est l'histoire d'un homme.\n"
43 << "This is the story of a man.\n";
44
45 std::wstring line;
46
47 // extract the first line
48 std::getline (inout, line);
49
50 // output the first line to stdout
51 std::wcout << "\nDeutsch:\n" << line;
52
53 // extract the second line
54 std::getline (inout, line);
55
56 // output the second line to stdout
57 std::wcout << "\nFrancais:\n" << line;
58
59 // extract the third line
60 std::getline (inout, line);
61
62 // output the third line to stdout
63 std::wcout << "\nEnglish:\n" << line << "\n\n";
64
65 // output the contents of the stream object to stdout
66 std::wcout << inout.str () << '\n';
67
68 return 0;
69}
#define line
Definition 17.names.cpp:490
int main()