int &rnum=12; It will change the memory location of variable mum so that next time we store something to variable mum, it will be stored at the memory location 12 overwriting the already stored contents if any. Its not advisable because in normal case we dont know if any other program or variables are already using the memory location 12 and overwriting it will lead to system crash.. So its better not to change the memory location this way instead use the functions malloc() or calloc() and pointers for dynamically assigning & creating variables.
The operator '&' is mainly used to get the address of a variable so that we can assign it to another pointer variable and use both variables to access the contents in that address location.
int mum=10; int *pmum; pmum=&mum;
print mum; print *pmum; will give 10 10
*pmum=20;
print mum; print *pmum; will give 20 20
mum=30;
print mum; print *pmum; will give 30 30
So, '&' is mainly used for only reading the address of variable and not to assign or change the address of variable even if its possible.






Reply With Quote