Datasheet
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 a 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. This code,
for example:
"\t\"Name\"\\\tAddress\n\n"
prints like this:
"Name"\ Address
The "Name" is preceded by two tabs; The Address is preceded by one tab. The line
is followed by two new lines. The \" provides interior double quotes. The escape
character sequence \\ is translated into \ by the compiler.
Adjacent string literals separated only by whitespace are concatenated during the
parsing phase. For example:
"This is " "just"
" an example."
is 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."
132
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroC PRO for AVR
CHAPTER 5