If i write a statement as int *ptr=0;
Does it mean that the address of ptr is zero???
No. The address of an object is the location in memory where it is. What this does is set the value of the pointer to zero. Somewhere in memory is the pointer named ptr, and if you look at that pointer, it has the number zero in it.
1 2
int i;
int *ptr=&i;
means that ptr has been assigned a address of i...
That's correct. Now, the pointer holds a number which is the number of the place in memory when you will find the int named i.
No. The address of an object is the location in memory where it is. What this does is set the value of the pointer to zero. Somewhere in memory is the pointer named ptr, and if you look at that pointer, it has the number zero in it.