Home > C Programming > Pointers > Questions and Answers
01. |
Predict the output or error(s) for the following? void main() { int const * p=5; printf("%d",++(*p)); } | |||||||||||
|
02. |
Predict the output or error(s) for the following? main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); } | |||||||||||
|
03. |
Predict the output or error(s) for the following? main() { char *p; p="Hello"; printf("%c\n",*&*p); } | |||||||||||
|
04. |
Predict the output or error(s) for the following? main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); } | |||||||||||
|
05. |
Predict the output or error(s) for the following? main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); } | |||||||||||
|
06. |
Predict the output or error(s) for the following? main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); } | |||||||||||
|
07. |
Predict the output or error(s) for the following? main() { int *j; { int i=10; j=&i; } printf("%d",*j); } | |||||||||||
|
08. |
Predict the output or error(s) for the following? main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); } | |||||||||||
|
09. |
Predict the output or error(s) for the following? void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); } | |||||||||||
|
10. | Which of the following is the proper declaration of a pointer? | |||||||||||
|