I don't understand the second line of this code.
int& max(int& m, int& n)
{return ( m > n ? m : n )
}
int main()
{ int m = 44, n = 22;
cout<< m << ", " << n<< ", " << max(m,n)<< endl;
max(m,n)= 55;
cout<< m << ", " << n<< ", " << max(m,n)<< endl;
}
Also, what is the point to return the value with references?
Thanks in advance,
Sasuke12
int& max(int& m, int& n)
{return ( m > n ? m : n )
}
int main()
{ int m = 44, n = 22;
cout<< m << ", " << n<< ", " << max(m,n)<< endl;
max(m,n)= 55;
cout<< m << ", " << n<< ", " << max(m,n)<< endl;
}
Also, what is the point to return the value with references?
Thanks in advance,
Sasuke12