"Alex6996xelA" <Al*****@netzoola.com> wrote in message
news:de**************************@posting.google.c om...
Which one sounds not better ?
type ya(type a1){
type a2;
//do lilt somethin' for ya
return a1; // return a2;
}
Soo sorry for newbie question because I am not a professional or
intermediate coder. Thank you in advance..
either return the a2 temporary or pass a1 by reference (which doesn't need a
return).
void Ya(type& a1)
{
a1 = 10;
}
a1 is an alias for the passed parameter (pass by reference)
Its equivalent to someone calling you by your name or nickname, both names
denote the same instance of person. Additionally, the relationship between
the reference and its object can't be broken in void Ya(...). The reference
is permanantly bound until the scope ends.