1.

Use of const member function in a program _________________________(a) Is mandatory, always(b) Is optional, always(c) Is mandatory, if objects are used(d) Is optional, if const objects are usedThe question was asked during an internship interview.This intriguing question originated from Constant Member Functions in chapter Member Functions & its Types of Object Oriented Programming

Answer»

Correct CHOICE is (b) Is optional, always

Explanation: The use of CONST MEMBER functions is not mandatory. If const objects are involved then there is a HIGH use of const member functions too. But there is no mandatory CONDITION.



Discussion

No Comment Found

Related InterviewSolutions