BS> class myoutput {
BS> public:
BS> void operator<< (char* s)
BS> {
BS> cout << s;
BS> }
BS> };
BS> void main ()
BS> {
BS> myoutput write;
BS> write << "Hello World";
BS> }
BS> --------------------------------------------------------------------
BS> I would like to be able to call my << function multiple times like t
BS> class. for example :
BS> write << "Hello " << "World";
Change your operator << to:
myoutput &operator<< (char* s)
{
cout << s;
return *this;
}
Thomas
---
þ MM 1.0 #0113 þ Infinity is one lawyer waiting for another.
--- PCBoard (R) v15.22/M 25
---------------
* Origin: McMeier & Son BBS (2:301/138)
|