Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
examples
manual
wostream.cpp
Go to the documentation of this file.
1
29
#include <iostream>
// for wcout, wostream, endl
30
#include <sstream>
// for wistringstream
31
32
#include <
examples.h
>
33
34
35
int
main
()
36
{
37
const
double
f
= 3.1415926;
38
39
const
wchar_t
s
[] = {
'K'
,
'e'
,
'n'
,
'a'
,
'v'
,
'o'
,
' '
,
'!'
,
'\0'
};
40
41
// create a read/write stringbuf object on wide char
42
// and attach it to an wistringstream object
43
std::wistringstream
in
(std::wios::in | std::wios::out);
44
45
// tie the wostream object to the wistringstream object
46
std::wostream
out
(
in
.rdbuf ());
47
48
out
<<
L
"test beginning !"
<< std::endl;
49
out
.setf (std::wios::fixed, std::wios::floatfield);
50
51
// output f in fixed format
52
out
<<
f
<< std::endl;
53
54
// store the current put-pointer position
55
std::wostream::pos_type
pos
=
out
.tellp ();
56
57
// output s
58
out
<<
s
<< std::endl;
59
60
// output the all buffer to standard output
61
std::wcout <<
in
.rdbuf () << std::endl;
62
63
// position the get-pointer
64
in
.seekg (
pos
);
65
66
// output s
67
std::wcout <<
in
.rdbuf () << std::endl;
68
69
return
0;
70
}
f
#define f
Definition
17.names.cpp:119
s
#define s
Definition
rw_alg_test.h:221
pos
#define pos
Definition
17.names.cpp:518
out
const int out
Definition
27.stringbuf.virtuals.cpp:443
in
const int in
Definition
27.stringbuf.virtuals.cpp:442
examples.h
L
Definition
20.meta.unary.nothrow.cpp:420
main
int main()
Definition
wostream.cpp:35
Generated by
1.9.8