Write a Program to find Minimum from Two values by passing object as argument.Passing input from keyboard. Consider Name of Class is Temp. Data Member : int x Member function : Get(int n) Max(Temp t)
Answers
Answered by
0
Answer:
Mark me in brainliest
Explanation:
If a function is defined as a friend function of a class, then that function can access all the private and protected data.
To make a function as a friend of a class, it is declared inside the class either in private or in public section with keyword friend before its declaration as follows.
class Temperature
{
int celsius;
public:
Temperature()
{
celsius = 0;
}
friend int temp( Temperature ) //declaring friend function
};
Here temp is a friend function of the class Temperature. So, it can access all the private and protected members of the class.
Similar questions