Demonstration of streambuf inheritance.
More...
#include <iostream>
#include <cstdio>
Go to the source code of this file.
|
class | dmsg |
| Demonstration of streambuf inheritance. More...
|
|
|
int | main (int argc, char **argv) |
|
Demonstration of streambuf inheritance.
- Purpose:
- Program that demonstrates inheriting from streambuf to act just like cout. The program comes from chapter 13 of "The C++
Standard Library" (Josuttis).
Also demonstrates the values of various types of variables when instantiated.
Definition in file streambuf.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 47 of file streambuf.cc.
References dmsg::i, and dmsg::p.
57 std::cout <<
"blah" << std::endl;
65 std::cout << std::endl;
66 std::cout <<
"i="<< i <<
"|ch="<<ch<<std::endl;
67 std::cout <<
"prompt:";
69 std::cout <<
"i="<< i <<
"|ch="<<ch<<std::endl;
76 std::cout <<
"msg_p->p is NULL" << std::endl;
79 std::cout <<
"msg_p->i is ZERO" << std::endl;
87 std::cout <<
"i_p is VALID" << std::endl;
90 std::cout <<
"i_p is NULL" << std::endl;
93 std::cout <<
"i_p is ZERO" << std::endl;
98 std::cout <<
"*i_p is ZERO" << std::endl;
100 std::cout <<
"*i_p=" << *i_p <<std::endl;
Demonstration of streambuf inheritance.