This is pretty awful code. (p+p[3]-p[1]) simply adds and subtracts offsets by p . p[3] is (char)'E' , which is 69 in ASCII. p[1] is (char)'A' , which is 65 in ASCII. Thus, the code is equivalent to:
(p+69-65)
which the:
(p+4)
So this is just a pointer offset by 4 elements before passing it to printf .
Technically, this behavior is undefined. The first part of this expression ( p+69 ) shifts the pointer beyond the end of an array that is not permitted by the C standard.
source share