222 views
1 votes
1 votes

2 Answers

0 votes
0 votes

Its is actually very simple about what the code is doing....

Case 1 : int size is 4

in this case the line t=(p+=sizeof(int))[-1]; willextract the last sring in the array (refer to pointer arithmetic here)(because of [-1] its "gh"

if its [-2] it will be "ef" and so on..

Case 1 : int size is 2

in this case the line t=(p+=sizeof(int))[-1]; will extract the last sring in the array (refer to pointer arithmetic here)

so it will print "cd"

if its [-2] it will print "ab"

Related questions

1 votes
1 votes
0 answers
1
garimanand asked Jan 6, 2019
406 views
1 votes
1 votes
0 answers
2
Nils asked Sep 2, 2017
145 views
1 votes
1 votes
1 answer
3
Nils asked Sep 2, 2017
296 views
0 votes
0 votes
0 answers
4
garimanand asked Jan 8, 2019
129 views