home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_11
/
1011051b
< prev
next >
Wrap
Text File
|
1992-09-08
|
572b
|
41 lines
********************************************************
// VSTREAM.CPP (Listing 6)
// Video stream package -- Williams
#include <iostream.h>
#include <conio.h>
class Conbuf : public streambuf
{
int do_sputn(const char *s,int n);
int overflow(int=EOF);
} conbuf;
int Conbuf::overflow(int c)
{
do_sputn((char *)&c,1);
return 1;
}
int Conbuf::do_sputn(const char *s,int n)
{
int n1=n;
while (n1--)
{
putch(*s);
if (*s++=='\n')
{
putch('\r');
clreol();
}
}
return n;
}
ostream conout=&conbuf;