#include<stdio.h>
void fun(const int *s)
{
printf("In this function %d\n",*s);
}
int main()
{
const int a = 10;
int *p = (int*)&a; // const int* to int*
printf("before modification a=%d\n",a);
*(int*)&a = 12;
printf("after modification a=%d\n",a);
printf("after modification p=%d\n",*p);
fun(&a);
//getch();
return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KCnZvaWQgZnVuKGNvbnN0IGludCAqcykKewogICAgcHJpbnRmKCJJbiB0aGlzIGZ1bmN0aW9uICVkXG4iLCpzKTsKfQoKaW50IG1haW4oKQp7Cgljb25zdCBpbnQgYSA9IDEwOwoJaW50ICpwID0gKGludCopJmE7IC8vIGNvbnN0IGludCogdG8gaW50KgoJcHJpbnRmKCJiZWZvcmUgbW9kaWZpY2F0aW9uIGE9JWRcbiIsYSk7CgoJKihpbnQqKSZhID0gMTI7CgoJcHJpbnRmKCJhZnRlciBtb2RpZmljYXRpb24gYT0lZFxuIixhKTsKCXByaW50ZigiYWZ0ZXIgbW9kaWZpY2F0aW9uIHA9JWRcbiIsKnApOwoJZnVuKCZhKTsKCS8vZ2V0Y2goKTsKCglyZXR1cm4gMDsKfQo=