InterviewSolution
Saved Bookmarks
| 1. |
What do we need to do to pointer for overloading the subscript operator?(a) reference pointer(b) dereference pointer(c) store it in heap(d) memory locatorThe question was asked in an interview for internship.Question is from Subscripting topic in division Source Files, Classes and Operator Overloading in C++ of C++ |
|
Answer» RIGHT OPTION is (b) dereference pointer Best explanation: If you have a pointer to an object of some class type that OVERLOADS the subscript operator, you have to dereference that pointer in ORDER to FREE the memory. |
|