0 0 votes #include<stdio.h> void fun(int *p,int *q) { p=q; *p=q; } int i=0,j=1; int main() { fun(&i,&j); printf("%d%d",i,j); } What will be the output of i and j in 16-bit C Compiler? Programming in C programming-in-c output programming pointers + – Mr khan 3 1.8k views answer comment Share Follow Print See all 6 Comments 6 6 Comments reply Show 3 previous comments Shaik Masthan commented Nov 3, 2018 reply Follow flag @Vikas Verma *p=q; *p means it is integer, q means integer pointer.... so, you can't assign them 0 0 replyShare Vikas Verma commented Nov 3, 2018 reply Follow flag On execution, I got a warning but not a compilation error for that. 0 0 replyShare Shaik Masthan commented Nov 3, 2018 reply Follow flag did you run it on offline ? because online compilers does some error recovery... But the concept is you can't assign them, even offline compilers also gives only warning message. After that it is your wish. 0 0 replyShare Please log in or register to add a comment.
0 0 votes #include<stdio.h> void fun(int *p,int *q) { p=q; /*3. p was pointing to i but now content of p are changed to address of q */ *p=q; /*4. p is pointing to j so now content of j are changed with its own address */ } int i=0,j=1; /*1. global variables i and j defined */ int main() { fun(&i,&j); /*2. function fun is called and addresses of i and j are passed as parameters */ printf("%d%d",i,j); /*5. 0 address-of-j-in-int */ } Output : 0 address-of-j-in-int https://ideone.com/CMYOAh Mk Utkarsh answered Nov 10, 2018 Mk Utkarsh comment Share Follow 0 reply Please log in or register to add a comment.