home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16759 < prev    next >
Encoding:
Text File  |  1992-11-23  |  1.2 KB  |  35 lines

  1. Path: sparky!uunet!mcsun!news.forth.gr!news.forth.gr!kilitzir
  2. From: kilitzir@antigone.csi.forth.gr (Xristos Kilitzirakis)
  3. Newsgroups: comp.lang.c++
  4. Subject: operator <</>> + streams
  5. Date: 23 Nov 1992 16:27:52 +0200
  6. Organization: Institute of Computer Science, FORTH Hellas
  7. Lines: 24
  8. Message-ID: <kilitzir.722527533@news.forth.gr>
  9. NNTP-Posting-Host: antigone.csi.forth.gr
  10.  
  11. 2 simple q.s for those who have the manual near by.Mine is
  12. 100 km. away.
  13. 1)-------------------------------------------------------------
  14. I want to specify the operators <</>> , but I want them to work
  15. either with o/istream or i/ofstream + strstream.I think that
  16. these derived from ios , yet I'm not quite sure.
  17. 2)------------------------------------------------------------
  18. Suppose the following small program:
  19. class line{ Data *p;data &operator[](int);}
  20. class matrix(line *p;data &operator[](int){return p[i];}
  21.                      ^^^^^^^^^^ 
  22. Are these operators properly defined for the following listing ?
  23. data x;
  24. matrix f(10,10);
  25. x = f[1][1];
  26. f[1][1] = x;
  27. It's a trivial question , if you know the answer.
  28.  
  29.  
  30.  Any answers apart from being appreciated , can be sent to
  31. kilitzir@csi.forth.gr
  32. kilitzir@ics.forth.gr
  33. kilitzir@csd.uch.gr
  34.  
  35.