0 votes 0 votes Shivangi Parashar 2 asked Aug 17, 2018 Shivangi Parashar 2 605 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments Rishav Kumar Singh commented Aug 17, 2018 reply Follow Share yes fg should be printed 0 votes 0 votes Shaik Masthan commented Aug 17, 2018 reply Follow Share @Bhagyashree Mukherje, it's my suggestion ( neither request nor order ), when you dealing with variable memory addresses and pointer memory addresses, take integer size=4B and Pointer Size=2B it will help you for more understanding 0 votes 0 votes Bhagyashree Mukherje commented Aug 17, 2018 reply Follow Share Ok.Will keep it in mind henceforth.Thanks 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes We're printing **++ptr+1 Adding brackets for simplicity (*(*(++ptr))+1) ptr points to p[0] *(++ptr) point to *p[1] which is s+1 *(s+1) points to "efg" printf("%s","efg" + 1); prints fg So answer is B) Vikas Verma answered Aug 17, 2018 Vikas Verma comment Share Follow See all 2 Comments See all 2 2 Comments reply Mayankprakash commented Aug 17, 2018 reply Follow Share @vikas @bhagyasree printf("%s","efg" + 1); Please suggest how it prints fg. I'm not able to understand this logic.Please help Thanks 0 votes 0 votes Rishav Kumar Singh commented Aug 17, 2018 i edited by Rishav Kumar Singh Aug 17, 2018 reply Follow Share Mayankprakash when we use %s it takes the starting address and print it till \0. in this case let addresses be like e f g 100 104 108 starting address of "efg" which is 100 , starting address of "efg" +1 means 104 so, %s will start from address 104 and print till \0 3 votes 3 votes Please log in or register to add a comment.