1.

Which of the following is correct?(a) Friend functions can access public members of a class(b) Friend functions can access protected members of a class(c) Friend functions can access private members of a class(d) All of the mentionedThe question was asked by my school principal while I was bunking the class.Enquiry is from OOPs Concept topic in division Basics Concepts of C++ of C++

Answer»

The CORRECT choice is (d) All of the mentioned

The best explanation: Friend functions can ACCESS any member of a CLASS without caring about the type of member i.e. without caring whether it is private, protected or PUBLIC.



Discussion

No Comment Found

Related InterviewSolutions