c1 c2 c3 are three classes.
c1 + c2 + c3 ?
will it work
Operator overloading
@ankitdelhi20
Well , you cannot do anything with the class names as such. You would need to make objects from it and then call the operators and/or functions as per your will.
Assuming c1, c2 and c3 are three different objects of the same class , it is very easy to overload the + operator in that class to make this statement work.
On the other hand , let’s say that c1,c2 and c3 are objects of three different classes , it is still possible to make the operator overloading work but you would have to overload the operator in atleast two of those classes and even still , there would be limited functionality you could perform.
However since your question is whether it will work , the answer is Yes for both the cases. You are the programmer. You can code it any way you want.