Debugging with GDB: C Constants |
---|
Next: C Plus Plus Expressions, Previous: C Operators, Up: C [Contents][Index]
GDB allows you to express the constants of C and C++ in the following ways:
long
value.
float
(as opposed to the default double
) type; or with
a letter ‘l’ or ‘L’, which specifies a long double
constant.
'
), or a number—the ordinal value of the corresponding character
(usually its ASCII value). Within quotes, the single character may
be represented by a letter or by escape sequences, which are of
the form ‘\nnn
’, where nnn is the octal representation
of the character’s ordinal value; or of the form ‘\x
’, where
‘
x
’ is a predefined special character—for example,
‘\n’ for newline.
Wide character constants can be written by prefixing a character constant with ‘L’, as in C. For example, ‘L'x'’ is the wide form of ‘x’. The target wide character set is used when computing the value of this constant (see Character Sets).
"
). Any valid character constant (as described
above) may appear. Double quotes within the string must be preceded by
a backslash, so for instance ‘"a\"b'c"’ is a string of five
characters.
Wide string constants can be written by prefixing a string constant with ‘L’, as in C. The target wide character set is used when computing the value of this constant (see Character Sets).
Next: C Plus Plus Expressions, Previous: C Operators, Up: C [Contents][Index]