Friend Class

A friend class in C++, can access the "private" and "protected" members of the class in which it is declared as a friend. On declaration of friend class all member function of the friend class become friend of the class in which the friend class was declared. Friend status is not inherited; every friendship has to be explicitly declared. Friend classes can help in improving Encapsulation if used wisely.

Read more about Friend Class:  Declaration, Advantages of Using Friend Class, Two Classes Accessing Private Data To Each Other, Scope, Features, Friend and Encapsulation

Famous quotes containing the words friend and/or class:

    A man’s growth is seen in the successive choirs of his friends. For every friend whom he loses for truth, he gains a better.
    Ralph Waldo Emerson (1803–1882)

    Where justice is denied, where poverty is enforced, where ignorance prevails, and where any one class is made to feel that society is in an organized conspiracy to oppress, rob, and degrade them, neither persons nor property will be safe.
    Frederick Douglass (c.1817–1895)