Hey,
I'm using friend function to overload the + operator but it keeps coming up with the error that the member variable is private "within this context".
I am developing the class to handle really large numbers
Thanks for the advice about returning references, I've looked them up now and I understand why it's a bad idea. I guess for the mean time I will just implement as a class member.
I'm still curious though, does anyone know why the friend function method was not working?
I copied and pasted your code from the first post, and the only change i made was make operator+ return a reference to a BigNumVect, and it compiled just fine for me.
(well, i got 2 warnings which would need investigation (returning a reference to a local variable is bad). But i could access the private members fine).
I've rewritten the code using friend functions after messing around with it and now it compiles. Now I have completely no idea why it wouldn't work in the first place.