转义字符

基本类型 / 字符类型

// \' for a single quote.
char c = '\'';

// \" for a double quote.
c = '\"';

// \\ for a backslash.
c = '\\';

// \0 for a null character, the end of every string.
c = '\0';

// \a for an alert character.
c = '\a';

// \b for a backspace.
c = '\b';

// \n for a new line.
c = '\n';

// \r for a carriage return.
c = '\r';

// \t for a horizontal tab.
c = '\t';

// \v for a vertical tab.
c = '\v';

// \x for a hexadecimal character code.
c = '\x41'; //Symbol A

// \ and up to three octal digits for an octal code.
char octal = '\101'; //Symbol A

const char *path = "\"C:\\temp\"";
//path is "C:\temp" with the quotes

printf("c is %c\n", c);
printf("octal is %c\n", octal);
printf("path is %s\n", path);