This blog aims at helping you learn C, Java and TASM programming languages and thus enabling you to use its immense possibilities in the computing world.It features Step by step instructions on doing a C program ,Complete Source Codes of C, Java and TASM Programs ,sample program downloads,programming tutorials and general tips for programmers.

Saturday, February 25, 2012

C++ Program to Implement Friend Class for Adding two Numbers

Friends are functions or classes declared using the friend keyword.
Friend Class can access the private and protected
members of the class for which it is friend to c,it is done by a declaring prototype of this
external function within the class, and with the keyword friend.

Friend class is used in C++ to gain access to protected members exclusively by the friend class
The following is an Example Program in C++ using friend class to fins the sum of two numbers