InterviewSolution
Saved Bookmarks
| 1. |
If left operand member is specified directly in the function definition, which is the correct implicit conversion of that syntax?(a) *this className(b) *this parameterObject(c) *this returnedObject(d) *this objectI got this question at a job interview.This is a very interesting question from Member Operator Function in division Member Functions & its Types of Object Oriented Programming |
|
Answer» RIGHT choice is (d) *this object The explanation is: SINCE the left operands are passed implicitly, those object members can be accessed directly in the function definition. The compiler converts the syntax into the syntax that can be processed. The implicitly converted syntax contains *this POINTER FOLLOWED by the objectName that is left operand in the expression. |
|