TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: BRIAN S
from: VINCENT GIBARA
date: 1997-10-29 23:50:00
subject: write

Brian S ecrivait ce qui suit dans un message a All:
Maybee you can try this:
#include 
class myoutput {
   public:
     void operator << (char *s, *t, *u, *v, *w, *x, *y, *z)
      {
       cout << s << t << u << v << w << x << y << z;
      }
   };
But i'm not sure if it will work... 
 BS> I was trying to make a class that worked similar to the cout class,
 BS> just for some practice and I was wondering if anyone could help. 
 BS> This is what I have done so far :
 BS> -------------------------------------------------------------------
 BS> ------- #include 
 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> ------- 
 BS> I would like to be able to call my << function multiple times like
 BS> the cout class.  for example :
 BS> write << "Hello " << "World";
 BS> Can anyone help?
 BS>                           Drumstick
 BS>                       =======O O=======
 BS> ___ FMail/Win32 1.22
 BS>  - Origin: CompuNerds BBS (602)497-2219 Mesa Arizona (1:114/480) 
Vincent Gibara
vince@qanet.org
www.qanet.org 
--- FMailX 1.40g
---------------
* Origin: cool.world 418-843-0162 - Quebec City! (1:240/99)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.