From a coding standpoint the friends list is simply a series of function prototype declarations that is preceded with the word friend and included in the class's declaration section. For example, if the functions named addreal() and addimag() are to be allowed access to the private members of a class named Complex, the following prototypes would be included within Complex's declaration section:
friend float addreal (Complex&, Complex&) ;
friend float addimag (Complex&, Complex&) ;
Here the friends list consists of two declarations. The prototypes indicate that each function returns a floating-point number and expects two references to objects of type Complex as arguments.