A friend class can access private and protected members of other classes in which it is declared as a friend. It is sometimes useful to allow a particular class to access private members of another class.
Friend Function:
A friend’s function can be given a special grant to access private and protected members. A friend function can be: a) A method of another class b) A global function
Answer:
Friend Class:
A friend class can access private and protected members of other classes in which it is declared as a friend. It is sometimes useful to allow a particular class to access private members of another class.
Friend Function:
A friend’s function can be given a special grant to access private and protected members. A friend function can be:
need an explanation for this answer? contact us directly to get an explanation for this answera) A method of another class
b) A global function