q-p supposed to return how many steps with increment you should do to go from p to q. Which is 1000 / sizeof(int) and equals 250. Remember q++ will actually go to the next element of type int, not in the middle of it, so it should add 4 to the actual value of the pointer. Hence the result.