-
rhs?
In my C++ book (Sams TYC++ in 21 days) when discussing classes it uses rhs in the member functions (what ever you wish to call them). Here is an example of what I getting this from-
Code:
Counter Counter::Add(const Counter & rhs)
{
return Counter(itsVal+ rhs.GetItsVal());
}
There is no variable named rhs... What is rhs? Is it just an alias or something?
-
rhs is a variable(reference) passed to the function.
rhs means 'right hand side', it's a common name for variables which don't really have any other meaningful name.
-
rhs is local to the function. it is the parameter passed to the function, but the Add function knows this variable as being rhs. as for what it stands for, not really sure. I've seen it used with overloaded assignment operators, and guessed it to mean 'right hand side' in that case.
edit: I guess it does mean 'right hand side'