@Ancient Dragon: Thanks for replying. I didn't understand what u pointed out. Could you elaborate.
@xpi0t0s: Thanks for replying. Its behavior is undefined with respect to different OS but otherwise predictable, if one knows the size of various types(as one wise man pointed out). What i have understood by gaining from helpful people like yourself is:
This is pointer arithmetic. as in
Here after execution of the 3rd line, the pointer would have advanced 3 positions from its current position. i.e. if initially pointer was at i then after this pointer would advance to i. But since an int is 2 Bytes(normally), on the memory level, the pointer advances 6 bytes(3 * 2bytes(for int)), from its current position.
One important thing to note is that sizeof(int) returns unsigned integer value.
(sizeof(int)+ (char *)'\0')
which is equal to (P + 2) as in the above example, resulting in (2 * 1(for char)).