Mikroelektronika MIKROE-738 Datenbogen

Seite von 682
182
mikoC PRO for PIC32
MikroElektronika
For example, the octal number 
\777
 is larger than the maximum value allowed (
\377
) and will generate an error. The 
first nonoctal or nonhexadecimal character encountered in an octal or hexadecimal escape sequence marks the end 
of the sequence.
Note: You must use the sequence 
\\ 
to represent an ASCII backslash, as used in operating system paths. 
The following table shows the available escape sequences:
Sequence
Value
Char
What it does?
\a
0x07
BEL
Audible bell
\b
0x08
BS
Backspace
\f
0x0C
FF
Formfeed
\n
0x0A
LF
Newline (Linefeed)
\r
0x0D
CR
Carriage Return
\t
0x09
HT
Tab (horizontal)
\v
0x0B
VT
Vertical Tab
\\
0x5C
\
Backslash
\’
0x27
Single quote (Apostrophe)
\”
0x22
Double quote
\?
0x3F
?
Question mark
\O
any
O = string of up to 3 octal digits
\xH
any
H = string of hex digits
\XH
any
H = string of hex digits
Disambiguation
Some ambiguous situations might arise when using escape sequences.
Here is an example:
Lcd_Out_Cp(“\x091.0 Intro”);
This is intended to be interpreted as 
\x09
 and 
“1.0 Intro”
. However, the mikroC PRO for PIC32 compiles it as the 
hexadecimal number 
\x091
 and literal string
 “.0 Intro”
. To avoid such problems, we could rewrite the code in the 
following way:
Lcd_Out_Cp(“\x09” “1.0 Intro”);
For more information on the previous line, refer to String Constants.
Ambiguities might also arise if an octal escape sequence is followed by a nonoctal digit. For example, the following 
constant:
“\118”
would be interpreted as a two-character constant made up of the characters 
\11
 and 
8
, because 
8
 is not a legal octal digit.