TM> AT> It is more like syntax sugar to me.
TM> Same for me. It syntactic sugar, needed for operator overloadin
TM> useful in many other cases.
TM> AT> Instead of writing *var argument definition and *var
TM> AT> where you use it, you just write &var
TM> It's * const var which replaced by &var; it's not poss
TM> to modify the target of a reference.
??? Since when? This program works just fine on my system:
#include
void ModViaRef(int &j);
int main()
{
int i = 5;
cout << "i = " << i << endl;
ModViaRef(i);
cout << "i = " << i << endl;
return 0;
}
void ModViaRef(int &j)
{
j = 10;
}
Regards,
Daniel ddjones@pinn.net
---
þ RM 1.31 1604 þ A revolving lithic conglomerate accrues no lichen.
---------------
* Origin: Selective Source Virginia Beach, VA (757)471-6776 (1:275/102)
|