Knowee
Questions
Features
Study Tools

Once an object is declared as a friend, _________________________.

Question

Once an object is declared as a friend, _________________________.

🧐 Not the exact question you are looking for?Go ask a question

Solution

it can access the private and protected members of the class in which it is declared as a friend. This is because the friend function is not a member of the class, but it must be listed in the class definition.

Similar Questions

What is a friend function? What are the merits and demerit of using friend function. Explain with example.

If the line:friend class A;appears in class B, and the line:friend class B;appears in class C, then:a.Class A is a friend of class C.b.Class A can access private variables of class B.c.Class C can call class A’s private member functions.d.Class B can access class A’s private variables.

Describe the process of creating an object of a class that contains objects of other classes as data members.

What happens when we declare a function as a friend?Select one:a.We allow the function to have access to the public members of the classb.We allow the function to have access to the private and protected members of the classc.We do not allow the function to have access to the private and protected members of the classd.We allow the function to have access to the protected members but not the private members of the class

In which stage of how friends develop do people think of themselves as friends and begin to establish their own private ways of interacting?Multiple Choicerole-limited interactionfriendly relationsnascent friendshipstabilized friendship

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.