your first program gives a warning because you r trying to store the address of const int variable into int type pointer.
here is the warning::" different 'const' qualifiers"
this is the reason you can change the value of const variable.if you create const type pointer variable then it gives an error : l-value specifier...
try this code..
Code:
void main()
{
int const i=123;
int *const ip;
/* Changing constant integer i.e. const int/int const */
printf(" %d %x \n",i,&i);
ip=&i;
*ip=456;
printf(" %d %x %x %d \n",i,&i,ip,*ip);
}
