Datasheet

ARM Compiler Reference
3-22 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
In C all character constants have type
int
. In C++ a character constant containing
one character has the type
char
and a character constant containing more than one
character has the type
int
. Up to four characters of the constant are represented in
the integer value. The last character in the constant occupies the lowest-order byte
of the integer value. Up to three preceding characters are placed at higher-order
bytes. Unused bytes are filled with the
NULL
(
\0
) character.
All integer character constants that contain a single character, or character escape
sequence (see Table 3-2), are represented in both the source and execution
character sets.
Characters of the source character set in string literals and character constants
map identically into the execution character set.
Data items of type
char
are unsigned by default. They can be explicitly declared
as
signed char
or
unsigned char
. The
-zc
option can be used to make the
char
signed.
No locale is used to convert multibyte characters into the corresponding wide
characters (codes) for a wide character constant. This is not relevant to the generic
implementation.
Table 3-2 Character escape codes
Escape sequence Char value Description
\a 7
Attention (bell)
\b 8
Backspace
\t 9
Horizontal tab
\n 10
New line (line feed)
\v 11
Vertical tab
\f 12
Form feed
\r 13
Carriage return
\xnn 0xnn
ASCII code in hexadecimal
\nnn 0nnn
ASCII code in octal