1 votes 1 votes Plz Explain with a diagram . Programming in C programming-in-c pointers + – dragonball asked Dec 18, 2017 dragonball 711 views answer comment Share Follow See 1 comment See all 1 1 comment reply Shubhanshu commented Dec 18, 2017 reply Follow Share It should be B) SIT Consider, GATE base address is 100. size of each cell is 1 CSIT base address is 200 size of each cell is 1 2018 base address is 300 size of each cell is 1 s base address is 400 size of each cell is 2 p base address is 500 size of each cell is 2. ptr value is 500 as it is pointing to p. **++ptr+1 here * and ++(pre) have higher precedence then +. ref :- http://www.difranco.net/compsci/C_Operator_Precedence_Table.htm above expression will be solved as (*(*(++ptr))+1) ++ptr value of ptr = 502. *502 = 402 *402 = 200 200+1 = 201 Now printf will print value from 201 which is SIT. 1 votes 1 votes Please log in or register to add a comment.
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 Akash Mittal answered Dec 18, 2017 • selected Dec 18, 2017 by dragonball Akash Mittal comment Share Follow See all 0 reply Please log in or register to add a comment.
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) OO7 answered Jun 19, 2018 OO7 comment Share Follow See all 0 reply Please log in or register to add a comment.