home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19758 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  1.1 KB

  1. Path: sparky!uunet!nestroy.wu-wien.ac.at!d21.wu-wien.ac.at!h8850513
  2. From: h8850513@d21.wu-wien.ac.at (Michael Tesar)
  3. Newsgroups: comp.lang.c++
  4. Subject: classes
  5. Date: 22 Jan 1993 17:17:45 GMT
  6. Organization: Wirtschaftsuniversitaet Wien
  7. Lines: 29
  8. Distribution: world
  9. Message-ID: <1jpa7pINNac9@nestroy.wu-wien.ac.at>
  10. NNTP-Posting-Host: d21.wu-wien.ac.at
  11.  
  12. Hello!
  13.  
  14. I have a problem with my classes matrix and amatrix.
  15. Class matrix is for simple 
  16. matrix operations, eg. multiplication
  17. In this class I have overloaded the operator*
  18.  
  19. matrix operator*(matrix& mat);
  20.  
  21. This class is working well and now I wanted to write a new class amatrix
  22. with all methodes of the matrix class - but I didnt like to change my 
  23. matrix class. But in this new class I had to overload the operator* again.
  24.  
  25. amatrix operator*(const double dvalue);
  26.  
  27. But now I cannot use the multiplication of two amatrix objects.
  28.  
  29. The only way to solve this problem - I know - is to write the function
  30. amatrix operator*(amatrix& mat);
  31. again, but I think this is not C++ like. 
  32.  
  33. Is there any possibility to avoid this dublication?
  34.  
  35. Thank you,
  36.  
  37. MichaeL
  38. C
  39. D
  40. Is there any possibility to avoid this dublication - better to-- 
  41.