This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/cplbexam/iostream/istream/conbuf.cpp

18 lines
342 B
C++

#include <iostream.h>
class mystream : public istream {
public:
mystream ( streambuf *str ) : ios ( str ), istream ( str ) {};
};
void main( void ) {
char ch;
mystream test ( cin.rdbuf() );
cout << "Enter a string (press CTRL-Z):" << endl;
while( (test >> ch).good() ) {
cout << ch << flush;
}
}