+ 1
[solved]What's the mistake in this program ??
Program to overload + operator https://code.sololearn.com/ca18PGKBn23e/?ref=app
14 odpowiedzi
+ 3
I altered it.
all the best on the exams.
the lack of address in overload and const
the lack of getter (to get private values)
https://code.sololearn.com/cx3kuuMj70tl/?ref=app
+ 3
what values of the two objects where being added?
+ 3
Reference used
cram hard bro.
https://www.cprogramming.com/tutorial/operator_overloading.html
+ 2
private
int value;
Void setData(int v){
value = v;
}
int main(){
obj2.setData(obj.getData()+obj1.getData());
//something like that hope it helps
}
+ 2
So when is your homework due?
+ 1
@manual I didn't understood wht u wanna say ??
+ 1
both a & b values from obj and obj1 are added !! AS IN COMPLEX NUMBERS
+ 1
@manual Yeah it's another way to solve the problem but...I don't wanna change the program ...there's little mistake in the program but I'm unable to identify that, hope u understand
I think your soln is little more complicated then the above program !!
+ 1
@manual don't worry I understood the basic concepts behind operator overloading I can write my exams ... effectively
+ 1
Awesome that's the thing which I wanted !!
+ 1
@manual check this
https://code.sololearn.com/cHjXg7jB7LdI/?ref=app
0
@manual it's for my exams ... I have to understand operator overloading I have my C++ exams tomorrow!!
0
Well I cannot help you more than your prof.
Try a video or an other user may be able to help you.
- 1
@thanks a lot manual you've tried your best !!