String constants

Top 

 

A string constant is the quoted sequence of the ASCII code characters: "...".

A string constant is the quoted character array; its type is char[].

To mark the end of string, the compiler places the null symbol '\0' in the end of each string.

If you need to include the quotation mark (") in a string, then enter the backslash (\) before the quotation mark. Any special character constants preceded by the backslash (\) can be included in the string.

A symbol can also be presented by its hexadecimal value (exactly two hexadecimal digits) preceded by the symbols of '\x'.

The string constants following in sequence are interpreted as one string constant. This is useful for the advance of the constant part to the next line, for example:

printf("Line 1\n"

       "Line 2");

Examples:

"This is the character string"

"A"

"1234567890\x33"

"_____________"

""