Variables: Basic Data Types
Applies To: C++Builder 1 or higher
Category: C++ Language
- C++ defines seven basic data types. They can be used when declaring a variable's type:
-
- char: character (-127 to 127)
- int: integer (-32767 to 32767)
- float: single-precision floating point (6 digits range precision)
- double: double-precision floating point (10 digits range precision)
- bool: boolean (true or false)
- wchat_t: wide-character (0 to 65535)
- void: no value
-
- There are several data types modifiers that can precede the previously listed data types:
-
- long
- short
- signed
- unsigned
-
- If a modifier is used but no data type is specified, the compiler assumes that it is an int. For example, unsigned int x; and unsigned x; are equivalent. It is not necessary to make an integer variable signed because integer variables are signed by default.
C++Builder Developer's Network
Copyright © Yoto Yotov