0

Can we add more than 2 or any number of objects via operator overloading?

Any operation for more than 2 objects ,is it possible ? Explain using addition.

19th Mar 2018, 4:32 PM
Abcdefg
1 Odpowiedź
+ 1
You mean like : Object a,b,c; cin>>a>>b>>c; Object m = a+b+c; ??? This is possible, as the + operator adds result of a and b to c, where result(a+b) is an object itself.
20th Mar 2018, 3:39 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar