From the course: Learning C++

Unlock the full course today

Join today to access over 25,200 courses taught by industry experts.

Basic data types

Basic data types - C++ Tutorial

From the course: Learning C++

Basic data types

- [Instructor] As with any programming language, it's essential to know the supported data types. C++ supports a very basic set of data types. Let's start with integers. Integer numbers may be signed or unsigned. There are several integer types in C++. There's the int type with a bit length that's implementation dependent. Usually it's 32 bits, but it's sometimes 16 bits. We also have the char type, which is short for character. It's eight bits wide, and it was designed to represent ASCII characters, but it's just a bite. You may use it as an integer if you want. Because these types may vary in length and sign, a very useful C library called stdint.h contains portable data types that specify the length and sign support of their types. For example, uint32_t is an unsigned 32 bit integer, and int8_t is a signed eight bit integer. C++ also supports floating-point numbers. Floating-point numbers represent real numbers as…

Contents