operator overloading problem.......
-
sir/mam can you please tell me if there is any particular reason why the following operators can't be oveloaded.. . :: ?:
-
sir/mam can you please tell me if there is any particular reason why the following operators can't be oveloaded.. . :: ?:
The mentioned operators are used for only one purpose. Example in c++ the '.' operator used only for accessing member functions. (so there is no use of overloading '.' ) . :: ?: But the symbols (+,- and etc..) are used to add numbers and objects . Ex: By default '+' operators are used for adding the numbers only and not the objects (we are overloading the '+' operator to add the objects ) In c++ operator overloading takes the meaning as below Operator Overloading: customize the operator to do other operations also(other than default operation). clear?
-
Great link! The explanations are even better than those found in Stroustrup's 'The C++ Programming Language' (that's what I checked, I was especially curious about :? and am somewhat disappointed that there isn't even a good reason against overloading it. I could think of a good use or two...)
-
Great link! The explanations are even better than those found in Stroustrup's 'The C++ Programming Language' (that's what I checked, I was especially curious about :? and am somewhat disappointed that there isn't even a good reason against overloading it. I could think of a good use or two...)