1.

Which keyword is used to make a nonmember function as friend function of a class?(a) friendly(b) new(c) friend(d) connectThis question was addressed to me in an online quiz.Origin of the question is Types of Member Functions topic in chapter Member Functions & its Types of Object Oriented Programming

Answer»

Correct ANSWER is (c) friend

The best explanation: The keyword friend is provided in PROGRAMMING LANGUAGES to USE it WHENEVER a functions is to be made friend of one class or other. The keyword indicates that the function is capable of new functionalities like accessing private members.



Discussion

No Comment Found

Related InterviewSolutions