1.

Which among the following is false, for a member function of a class?(a) All member functions must be defined(b) Member functions can be defined inside or outside the class body(c) Member functions need not be declared inside the class definition(d) Member functions can be made friend to another class using the friend keywordThe question was posed to me in homework.This key question is from Classes topic in portion OOPs Concept & Features of Object Oriented Programming

Answer»

The correct answer is (C) MEMBER functions NEED not be declared inside the class definition

To explain I would say: Member functions must be declared inside class body, though the definition can be GIVEN OUTSIDE the class body. There is no way to declare the member functions outside the class.



Discussion

No Comment Found

Related InterviewSolutions