Page 18 - 6437
P. 18
Floating-point Literals
A floating-point literal has an integer part, a decimal point, a fractional part, and an
exponent part. You can represent floating point literals either in decimal form or exponential
form.
While representing decimal form, you must include the decimal point, the exponent, or
both; and while representing exponential form, you must include the integer part, the fractional
part, or both. The signed exponent is introduced by e or E.
Here are some examples of floating-point literals:
3.14159 /* Legal */
314159E-5L /* Legal */
510E /* Illegal: incomplete exponent */
210f /* Illegal: no decimal or exponent */
.e55 /* Illegal: missing integer or fraction */
Character Constants
Character literals are enclosed in single quotes, e.g., 'x' can be stored in a simple variable
of char type.
A character literal can be a plain character (e.g., 'x'), an escape sequence (e.g., '\t'), or a
universal character (e.g., '\u02C0').
There are certain characters in C that represent special meaning when preceded by a
backslash, for example, newline (\n) or tab (\t). Here, you have a list of such escape sequence
codes:
Escape Meaning
sequence
\\ \ character
\' ' character
\" " character
\? ? character
\a Alert or bell
20