Note that: *(*(p + i) + j) and *(*(i + p) + j) is same.
Similarly *(*(j + p) + i) and *(*(p + j) + i) is equivalent.
printf can be rewritten as: printf ("%d %d %d %d", p[i][j], p[j][i], p[i][j], p[j][i])
since *(p + offset) is equivalent to p[offset].
This would print successive values of the array 'a' as i iterates from [0, 2) and
j iterates from [0, 3):
1 1 1 1
2 2 2 2
3 3 3 3
2 2 2 2
3 3 3 3
4 4 4 4
For eg on first iteration of i and j,
it would print 1, 1, 1, 1 since i == 0 and j == 0
When i == 0, and j == 1
p[i][j]
== p[0][1]
== 2
and p[j][i]
== p[1][0]
== 2
So it would print 2 2 2 2
and so on.