#include #include class wstreambuf : public streambuf { public: int overflow(int c); wstreambuf() : streambuf() {;} ~wstreambuf(); }; wstreambuf::~wstreambuf() { return; } int wstreambuf::overflow(int c) { if ( ( c == '\n' ) ) printf("\n\r"); else printf("%c",c); return 0; } wstreambuf wbuf; ostream wout(&wbuf); int main(void) { char i = '5'; wout << i << '\n'; wout << "Kissa istuu puussa!" << endl; return 0; }