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 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
Get step-by-step solutions from verified subject matter experts
