mikroC

mikroC - C Compiler for Microchip PIC microcontrollers

making it simple...

String Constants

String constants, also known as string literals, are a special type of constants which store fixed sequences of characters. A string literal is a sequence of any number of characters surrounded by double quotes:

"This is a string."

The null string, or empty string, is written like "". A literal string is stored internally as the given sequence of characters plus a final null character. A null string is stored as a single null character.

The characters inside the double quotes can include escape sequences, e.g.

"\t\"Name\"\\\tAddress\n\n"

Adjacent string literals separated only by whitespace are concatenated during the parsing phase. For example:

"This is " "just"

" an example."

is an equivalent to

"This is just an example."

Line continuation with backslash

You can also use the backslash (\) as a continuation character to extend a string constant across line boundaries:

"This is really \

a one-line string."

page

 

44

MikroElektronika: Development tools - Books - Compilers