字符转义

基本类型 / 字符串

// \t Insert a tab.
// \n Insert a newline.
// \r Insert a carriage return.
// \' or ' Insert a single quote.
// \" Insert a double quote.
// \\ Insert a backslash character.
// \0 Insert a zero character, it ends the string.
// \x41 Insert a character by its hex code ('A').

char str[] = "She said \"Hello!\" to me.";
//str is "She said "Hello!" to me."

char path[] = "C:\\Temp";
//path is "C:\Temp"

printf("str is %s\n", str);
printf("path is %s\n", path);
//printf has its own escaping: the percent sign is doubled
printf("progress is 100%%\n");