[Solved] C++ – Self made Big integer class gives errors


You didn’t say exactly what errors you were getting, but you added some in-line comments. It’s best to post the exact error message separately from the code (and also indicate which line it came from, and what you expected that line to do).

Looking at this one:

if (a.leftLeft == b.leftLeft = 0){

there is a problem. The result of a.LeftLeft == b.leftLeft is either true or false. Then you do the assignment =0 on that, so you are attempting either true = 0 or false = 0, neither of which are valid assignments. You can’t assign 0 to an rvalue.

I’m not really sure what your code was trying to do. If you meant to check if both of those variables are zero then the code is:

if ( a.leftLeft == 0 && b.leftLeft == 0 )

solved C++ – Self made Big integer class gives errors