Reference parameter question of friend function
ATL / WTL / STL
1
Posts
1
Posters
4
Views
1
Watching
-
Complex Complex::operator++(Complex & c )
{
return (++c.Real , ++c.Image) ;
}The above is a friend function. I copied from one article, it said, since the operator++ function is a friend function of Complex class, so the parameter c must be Complex&. I wonder why it must be a Complex &, not a Complex. Thanks