CSC 2110 Lecture Notes - Lecture 12: Function Prototype, Operator Overloading, Reserved Word

31 views2 pages

Document Summary

Extends definition of operator to work with a user-defined data type. C++ allows you to extend the definitions of most of the operators to work with classes. Assignment and member selection are the only built in operations of classes. Other operators cannot be applied directly to class objects by default. If both operands of / are integers, the result is an integer; otherwise, the results is a floating-point number. C++ allows the user to overload most of the operators so that the operators can work effectively in a specific application. To overload an operator for a class. You cannot change the precedence of an operator. Cannot change change the number of parameters an operator takes. For objects of the user defined type. For a combination of objects of the user defined type and objects of the built in type. Sometimes, it is necessary for a member function to refer to the object as a whole single unit.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents