#include
int main()
{
const int a = 12;
int *p;
p = &a;
*p = 70;
}
Will it work?
You cannot change the value of a constant variable by using a pointer pointing to it. This type of pointer is called as Pointer to a constant
.
There is also another concept called Constant Pointer
. It means that once a pointer points to a memory location you cannot make it point to the another location.