1. What is friend function
What function is ordinary function and another feature of C++. Which is very useful when we use Private or Public classes both.
2. What the use of friend function
Some Time we write programme in C++ and declare some member private and some public but in case we another class which not derived to main class and we need to use member of main class then friend function provide a facility to access private member in any class.
3. How to use friend function
It's easy to use and not complex we just declare this function with keyword of friend
draback of friend function??
ReplyDelete