Printf's first parameter is a format string. The variable p is a pointer to a character array which is also how strings are represented. When p is assigned a string "%d\n" it says format an integer to print its value and then print the carriage return character. Since p is a char pointer p++ means move the pointer forward 1 character. This is done twice to move p forward 2 characters so it points to the beginning of the carriage return character. P-2 says do pointer math to give a char* 2 characters in front of where p points. This is the beginning of the %d carriage return string. This becomes the format string and the second parameter 400 replaces the %d and prints itself followed by the carriage return.