c - Pointer assignment Problem -
when run above program in gcc complier(www.codepad.org) output disallowed system call: sys_socketcall please clear why error/output comes?
int main() { int i=8; int *p=&i; printf("\n%d",*p); *++p=2; printf("\n%d",i); printf("\n%d",*p); printf("\n%d",*(&i+1)); return 0; }
what have observed becomes inaccessible after execute *++p=2;why?
when *p = &i
, make p
point single integer i
. ++p
increments p
point "next" integer, since i
not array, result undefined.
Comments
Post a Comment