Tools.h++ Manual
21-202 104011 Tandem Computers Incorporated
21
of its representation on the target machine. By contrast, member functions
get()
and
put()
should treat the character as a literal number, whose value is
to be preserved. See also class
RWpostream
.
Example
Public operators
virtual RWvostream& operator<<(const char* s) = 0;
Store the character string starting at
s
to the output stream. The character
string is expected to be null terminated.
virtual RWvostream& operator<<(const wchar_t* ws) =
0;
Store the wide character string starting at
ws
to the output stream. The
character string is expected to be null terminated.
virtual RWvostream& operator<<(char c) = 0;
Store the char
c
to the output stream.
Note –
c
is treated as a character, not a number.
virtual RWvostream& operator<<(wchar_t wc) = 0;
Store the wide char
wc
to the output stream.
Note –
wc
is treated as a character, not a number.
#include <rw/vstream.h>
void storeStuff( RWvostream& str)
{
int i = 5;
double d = 22.5;
char string[] = "A string with \t tabs and a newline\n";
str << i;// Store an int
str << d;// Store a double
str << string;// Store a string
if(str.fail()) cerr << "Oh, oh, bad news.\n";
}