711 views
1 votes
1 votes

Plz Explain with a diagram .

2 Answers

Best answer
2 votes
2 votes
Address Strings
1000 GATE
2000 CSIT
3000 2018

Assume pointer size = 8byte

Char size = 1byte

Elements of Array S 1000 2000 3000
Address 4000 4008 4016
Elements of Array P 4016 4008 4000
Address 5000 5008 5016

p=5000

**++p+1 =**++5000+1 = **5008+1 = *4008+1 = 2000+1 = 2001 

o/p: SIT

selected by
0 votes
0 votes
**++ptr+1=**(++ptr)+1=**(p+1)+1=*(s+1)+1

*(s+1)=s[1]=CSIT

hence *(s+1)+1=SIT

answer is (B)

Related questions

3 votes
3 votes
1 answer
1
Storm_907 asked Apr 16, 2023
461 views
Please explain this question void main() { int a =300; char *ptr = (char*) &a ; ptr++; *ptr=2; printf("%d" , a); }
4 votes
4 votes
4 answers
3
Manoj Kumar Pandey asked May 22, 2019
818 views
https://gateoverflow.in/?qa=blob&qa_blobid=14433986388826671915int main() { int a = 10; int *b = &a; scanf("%d",b); printf("%d",a+50); }What will be the Output of the fol...