Types

Basic Data Types

Integers

 - can be signed or unsigned

 - size depends on the implementation - can be 16 bits but usually 32 bits

 - char - this is a character but is really just a byte so it can be used as an 8 bit integer

 - stdint.h - a useful library containing portable types with descriptive names, for instance an unsigned 32 bit integer would be uint32_t. A list of these types can be found in the online documentation at cplusplus.com

Floating-Point Numbers

 - implements the IEEE754 binary floating point standard (if you are interested, you can dowbnloard a copy of the standard from here.

 - three different types in C++, float, double and long double. Float is the least precise, long double is the most precise. More precision also means that the number uses more memory, requires more processing power etc

Boolean

 - referred to as bool in C++

 - possible values are true and false (lower case)

 - 0 is recognised as false and any other integer as true

The String Class

 - as we saw earlier, C++ does not have native support for strings

 - can be represented as an array of characters terminated with a 0 (just like C)

 - strings are supported as a class in the C++ standard library - the header file, string.h, provides both the class and several string manipulation functions

Pointers

 - store memory addresses

 - can act as references to variables

 - can also act as a reference to a sequence of variables

The online reference for C++ can be found at cppreference.com.