Lecture9 - Creating New Definitions For Operators
Lecture9 - Creating New Definitions For Operators
Programming in C++
Lecture 9
Student can
▪ know the most exciting features of object-oriented programming
▪ apply user-defined data type – operator
▪ create operator overloading function
Class ‘s
instance
++c1; // by using increment operator ++
• Normal C++ operators can be given new meanings when applied to user-
defined data types.
• The keyword operator is used to overload an operator, and the resulting
operator will adopt the meaning supplied by the programmer.
• Closely related to operator overloading is the issue of type conversion.
• Some conversions take place between user-defined types and basic types.
• 1,2,3,5,6,7