Recent questions tagged pointers

0 votes
1 answer
183
#include <stdio.h>#define R 10#define C 20int main(){ int (*p)[R][C]; printf("%d", sizeof(*p)); getchar(); return 0;}a200B4c800D80
0 votes
3 answers
184
ptrdata is a pointer to a data type . The expression *ptrdata++ is evaluated as ( in C++) a) *(ptrdata++) b) (*ptrdata)++c) *(ptrdata)++ d) depends on compiler
1 votes
1 answer
185
0 votes
1 answer
188
0 votes
0 answers
189
1 votes
3 answers
190
#include<stdio.h>int main() {int array [3]={5,10,15,20,25,30};int (*ptr) [3]=&array;printf("%d\t", (*ptr+1));}can someone explain how is it "20"??
1 votes
2 answers
191
#include<stdio.h>int main() { int const * i= 5; printf("%d\n", ++(*i));} a. 5b. garbage valuec. compilation errord.runtime error
8 votes
1 answer
192
1 votes
1 answer
193
main() { int * ptr =(int *) malloc (5*sizeof(int)); for(i=0;i<5;i++) *(ptr+i)=i; pf("%d",*ptr++); pf("%d",(*ptr)++); pf("%d",*ptr1); pf("%d",*++ptr); pf("%d",++*ptr); }
0 votes
3 answers
194
#include <stdio.h void f(int,int); int main(void){ int a = 5; f(a,a); printf("%d",a); } void f(int x, int y){ x ; y=y+15; }If copy-restore is used, then what will be the ...
1 votes
1 answer
195
Explain the Output of the Following C Code: int main() { char s[]={'g','a','t','e','c','s'}; char r[]={'G','A','T','E','C','S'}; char *p,*q,*str1,*str2; p=&s[4]; q=&r ; s...
0 votes
2 answers
196
we can subtract 2 pointer address then why we can't perform operations like addition, multiplication or division on pointer address???any specific reason?
1 votes
1 answer
197
#include <stdio.h int main(void){ int i=511; char *p = (char *)&i; printf("%d", *p); }OK so why take 2's complement and not simple binary number? Means, why is C giving -...
3 votes
0 answers
198
Illustration of this piece of code :
3 votes
0 answers
199
#include<stdio.h>int main(){ int a = 10; void *ptr = &a; printf("%d", sizeof(ptr)); return 0;}output =8how ?if we know size of pointer is already machine depe...
1 votes
0 answers
200
pls explain why option d is wrong ?
1 votes
1 answer
203
Analyze what is happening and why?int *ptr=(int*)0X12341230; int *ptr2=((int*)(((char*)ptr)+1));char *ptr=(char*) 0X12341230; void *ptr2=ptr+1;
1 votes
1 answer
204
1 votes
0 answers
206
5 votes
1 answer
207
char array [12][12][12]what is valid initialization of p ?ANS = char * * * * *p=array;but i feel it should be char * * * * * *p =array;please help
2 votes
3 answers
209
1 votes
1 answer
210