operator overloading | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

operator overloading

how can i overload " >> " operator to assign a object of a class to the object of other class?

27th Jun 2016, 6:18 AM
Nikhil Mishra
Nikhil Mishra - avatar
1 Answer
0
class1 operator>>(const class1& a const, class2& b) { ... } You should use this as class1instance >> class2instance
27th Jun 2016, 10:40 AM
Garme Kain
Garme Kain - avatar