home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!eagle!ariel.lerc.nasa.gov!smneyln
- From: smneyln@ariel.lerc.nasa.gov (Michael Neylon)
- Subject: HELP with overloading binary operator...
- Message-ID: <28JUL199210114546@ariel.lerc.nasa.gov>
- News-Software: VAX/VMS VNEWS 1.41
- Sender: news@eagle.lerc.nasa.gov
- Organization: NASA Lewis Research Center
- Date: 28 Jul 1992 10:11 EST
- Lines: 29
-
- I have the following class...
-
- classs ARRAYBASE {
- private: float matrix[MAXSIZE][MAXSIZE];
- public: int xsize, ysize;
- ARRAYBASE(int x, int y) {xsize=x+1;ysize=y+!;};
- // put + get handlers
- // overloaded operator= which is fine
- // Inverse() function, taken from _Num. Rec. in C_
- ARRAYBASE ARRAYBASE::operator*(ARRAYBASE array1, ARRAYBASE array2)
- {
- //fill the array using matrix multiplication
- //fill in matrix[][] and xsize, and ysize vars
- return *this;
- };
- };
-
- (obviously, this defines arrays with a base as 1 (a[1..6][1..6]))
- However, when i compile, i get...
- ARRAYBASE::operator*() must take only 0 or 1 arguments
- huh? this is the same format that I can find in several C++ books for
- overloaded binary operators. Whats wrong?!
-
- Mike Neylon aka Masem the Great and Almighty Thermo GOD
- // Only the | Univ. of Toledo - Chemical Engineering - Senior
- \X/ AMIGA! | NASA Lewis Research Center - Summer Intern
- \_____________|_____smneyln@ariel.lerc.nasa.gov________________/
- -+ How do YOU spell 'potato'? How about 'lousy'? +-
- "Me and Spike are big Malcolm 10 supporters."-J.S.,PLCL
-