Question: 1. Why do we use friend function? Suppose that class A has two private member variables named X and Y. get() is a non-member function.

 1. Why do we use friend function? Suppose that class A

1. Why do we use friend function? Suppose that class A has two private member variables named X and Y. get() is a non-member function. Is it possible to get access the private members of class A using get() function ? If yes, explain the way with example (program)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!