Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
A data type is the form that data (for example: numbers, words, images) has. Every variable has a data type. C++ is type safe, which means that during compiling it checks that all conversions are legal.
The example below the definition of a variable of data type double with the name of 'd' being assigned the value 3.1415. The next line tries to assign the text 'hello world' to d, which is illegal, because 'hello world' if not of data type double (but of std::string).
int main() |
Use a consistent method (such as uppercase first letter) to distinguish type names [1].
Some data types are only accepted by some standards:
The range of each of these data types can be found with std::numeric_limits.
This list will never be complete and is just a colorful collection of classes.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.