May 2012
Intermediate to advanced
679 pages
16h 56m
English
The ampersand operator ‘&’ is pronounced as “and” for simplicity. When we apply this to x we write it as &x and pronounce “and x”. We mean address of x by this expression. Naturally, there will be restrictions on what x can be. To have an address, x must reside in memory. Hence, it must be a variable (except for register variable). x can be an array element either. Note x cannot be expression (as it does not have a specific memory location). If our program has following declarations:
int i, a[30];
float x, y[25];
we are allowed to say &i , &a[0], &a[27] ,&x, &y[21] etc. However, we cannot say &(23+4).
Read now
Unlock full access