#include "graphics.h" extern ostringstream bgiout; void outstream(ostringstream& out=bgiout); void outstreamsy(int x, int y, ostringstream& out=bgiout);
bgiout. This output stream can be written to just like
coutor any other output stream. However, the information written to bgiout does not appear in the graphics window until the program calls
outstreamxy functions work
except that they print from an
ostringstream rather than
from an ordinary string. The
outstream function prints
its information in the active graphics window at the current pointer.
outstreamxy function prints its information in the
active graphics window at coordinates (x,y).
Both functions clear the ostreamstream after printing its information.
Both functions use the global
bgiout as the default value
#include "graphics.h" initwindow(400, 400); bgiout << "Hello, World!" << endl; bgiout << 42 << endl; outstreamxy(100, 100); getch( ); closegraph( );