hi,
#include<stdio.h>
int main()
{
const int i=10;
int *ptr= (int*)&i;
printf("%d",*ptr);
*ptr=11;
printf("%d",*ptr);
printf("%d",i);
getch();
return 0;
}
in this, we trickly changed the value of a constant variable. how is it changing the value of i ? in the o/p it is giving o/p , value of i as 11 after changing it. it has confused me. please comment on this.
thanks in advance.