Recent questions tagged pointers

2 votes
2 answers
211
int main() { static char a[5][20]={"mona","vijay","kumar","Nakuru","suresh"}; int i; char *p; p=a[3]; a[3]=a[4]; a[4]=p; for(i=0;i<=4;i++) printf("%s",a[i]); }which line ...
1 votes
2 answers
212
int main() { int a[5]={1,2,3,4,5}; int *ptr=(int *)(&a+1); // why is typecasting necessary here? It can just be int*ptr=&a+1; printf("%d%d",*(a+1),*(ptr-1)); }2 5garbagec...
0 votes
2 answers
216
What is the Output of following code?void main(){int i=10;int *j;void *k;k=&i;j=&i;k++;j++;printf("Address of j=%u",j);}
0 votes
1 answer
217
What is this pointer? and what is the use of this pointer?
2 votes
1 answer
219
0 votes
1 answer
220
#include <stdio.h int*fun() { intx=5; return&x; } int main(){ int*p=fun(); fflush(stdin); printf("%d",*p); return0; }Please explain this code, how's it's working line by ...
2 votes
3 answers
222
char *c[] = {"GeksQuiz", "MCQ", "TEST", "QUIZ"}; char cp[] = {c+3, c+2, c+1, c}; char *cpp = cp; int main() { printf("%s ", ++cpp); printf("%s ", * *++cpp+3); printf("...
70 votes
13 answers
223
30 votes
11 answers
225
1 votes
1 answer
226
Determine the output-#include <stdio.h int main(void) { char *p="gateoverflow"; *(p+5)='z'; printf("%s",p); return 0; }
1 votes
2 answers
227
1 votes
1 answer
228
5 votes
2 answers
230
int i=0; char *a = "abcde\0efgh"; while(a[++i]) printf("%d",*++a - 'a');the output of the above c code segment?
0 votes
1 answer
231
char *p;*p='a' ;I know this will give compiler error but can anyone explain what is the actual bug in this and how to rectify it??
0 votes
0 answers
232
2 votes
1 answer
233
1 votes
2 answers
234
How to read them??I. int (*a)();II. int (*a[5])();III. int *(*a)();IV. int (*a)()V. int *(*a)[10]
1 votes
1 answer
235
how can int pointer be used to point to string constant??? even if we consider that address was passed to int pointer then when while(*++p1) is executed it must raise err...
0 votes
2 answers
236
3 votes
1 answer
237
which of the following expressions have l-values ? which have r- valuesa)A[I+1] b)*A c)&Ad)&(*A) e)*(&A) f)*(&(&A))
3 votes
4 answers
238
3 votes
1 answer
239
0 votes
0 answers
240