BS> void main ()
BS> {
BS> myoutput write;
BS> write << "Hello World";
BS> }
BS>
-------------------------------------------------------------------------
BS>
BS> I would like to be able to call my << function multiple times like the
cout
BS> class. for example :
BS>
BS> write << "Hello " << "World";
Overload the '<<' operator for each primitive data type like so.
friend myoutput& operator<< (myoutput& m, char* c) {
m.Ostream << c;
return m;
}
// I'm assuming that Ostream is an ostream object
myoutput m;
m << "String 1" << "string 2";
m<<"String 1" - returns a myouput reference
myouput& << "string 2" - returns a myoutput reference
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)
|