RAD Studio |  |

Constants Overview
Collapse All

This section contains Constant topics.

Topics

Name | Description
Character Constants Overview | This section contains Character Constant topics.
Constants | Constants are tokens representing fixed numeric or character values. The compiler supports four classes of constants: integer, floating point, character (including strings), and enumeration. Internal representation of numerical types shows how these types are represented internally. The data type of a constant is deduced by the compiler using such clues as numeric value and the format used in the source code. The formal definition of a constant is shown in the following table. Constants: Formal Definitions
Integer Constant Without L Or U | Decimal constants
Constant Expressions | This section contains Constant Expression topics.
Constants and Internal Representation | This section contains Constants and Internal Representation topics.
Floating Point Constants | A floating-point constant consists of: Decimal integer Decimal point Decimal fraction e or E and a signed integer exponent (optional) Type suffix: f or F or l or L (optional) You can omit either the decimal integer or the decimal fraction (but not both). You can omit either the decimal point or the letter e (or E) and the signed integer exponent (but not both). These rules allow for conventional and scientific (exponent) notations. Negative floating constants are taken as positive constants with the unary operator minus (-) prefixed. Here are some examples:
Enumeration Constants | This section contains Enumeration Constant topics.
Integer Constants | Integer constants can be decimal (base 10), octal (base 8) or hexadecimal (base 16). In the absence of any overriding suffixes, the data type of an integer constant is derived from its value, as shown in Integer constants without L or U.. Note that the rules vary between decimal and nondecimal constants. Decimal Decimal constants from 0 to 4,294,967,295 are allowed. Constants exceeding this limit are truncated. Decimal constants must not use an initial zero. An integer constant that has an initial zero is interpreted as an octal constant. Thus,
Internal Representation of Numerical Types | This section contains Internal Representation of Numerical Type topics.
String Constants | This section contains String Constant topics.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!