Professional Documents
Culture Documents
Friend Function in C++
Friend Function in C++
class class_name
{
friend data_type function_name(argument/
s); // syntax of friend function
};
data_type function_name(argument/s)
{
//body of friend function
}
• Program is discussed in class lecture, refer
there.
• A friend function can become friend to more
than one classes.