In the below code:
int a=5,b=6,c=7;;
int *const ptr = &a;
//if ptr = &b; is wrong since it is a pointer constant.
whether deferencing the pointer is applicable or not?
*ptr = 8; //is it allowed?
If not, then why?
Then in which places is the deferencing applicable?
In this case the pointer is constant but the data to which it points is not constant.
So you cannot make the pointer point to some other variable but you can modify the pointed value.
is allowed because it only changes the value stored at the address to which the pointer points.