– Modifier operators change the state of the leftmost operand in the expression. Modifier operators are ideal candidates for[r]
(1)Session 5- Class Basics Contd
Normal Member Functions
(2)Session – Class Basics
contd 2/34
Objectives
• Normal Member Functions
– Implicit Parameters – Queries
– Modifiers – this
• Overloaded Member Functions
– Constructors – Operators
(3)Objectives…
• Helper Functions
– Operand Symmetry – Friends
• Friend Functions • Friend Classes
– Helpers
(4)Session – Class Basics
contd 4/34
Normal Member Functions
• An object communicates with the outside world through queries and modifiers
• Queries and modifiers are member functions of the object's class
(5)Implicit Parameters
• Each member function has direct access to all members of its class, including
private members
• There is no need to pass the values of these instance variables through a
(6)Session – Class Basics
contd 33/34
Helpers(3)
• Overloaded operators are either modifiers or helpers
– Modifier operators change the state of the leftmost operand in the expression
Candidates include +=, -=, *=, /=, =, ++, and Modifier operators are ideal candidates for
member functions
(7)Summary
• Normal Member Functions
– Implicit Parameters – Queries
– Modifiers – this
• Overloaded Member Functions
– Constructors – Operators
– Pre-Fix Operators – Post-Fix Operators
Q&A
• Helper Functions
– Operand Symmetry – Friends
• Friend Functions • Friend Classes – Helpers