g++ -c testBigNum.cpp -o testBigNum.o
testBigNum.cpp: In function ‘int main()’:
testBigNum.cpp:14: error: no match for ‘operator=’ in ‘c = a.bigNum::operator+(((bigNum&)(& b)))’
BigNum.h:24: note: candidates are: bigNum& bigNum::operator=(bigNum&)
Could any please help me to figure out what is happening. I got this error after writing code for overloading
+
. Overloading of
=
was working before i wrote code for overloading
+
. So, I guess that my function definition is wrong for operator
+
Thanks.
--------------------------
Pasted below is my code.
You've defined bigNum & operator=(bigNum &);, but the compiler expects the assignment to bebigNum & operator=(const bigNum &);. You should consider making the input parameters to the other operators const as well.