The Most Common C++ Built-In Data Types - C++ Data Type

C++ examples for Data Type:Introduction

Introduction

Type Description
int A number with no decimal point. The values 0, 1, -57, and 1000 are examples of integers . Integers usually contain 4 bytes of data.
short Short integer. Same as an integer, but it usually contains 2 bytes of data.
long Long integer. Same as an integer and usually contains 4 bytes of data, but with some compilers, it can contain 8 bytes of data.
unsigned Unsigned integer. Can only contain values that are greater than or equal to 0. The unsigned integer usually contains 4 bytes of data.
float Floating-point number. A number with a decimal point . The values 0.0, 1.2,0.00012345, and -10.5 are all examples of floating-point numbers . Floating-point numbers usually contain 4 bytes of data.
double Double-sized floating-point number. Same as a floating-point number, but it usually contains 8 bytes of data.
char Character. Contains characters . The char type contains 1 byte of data.
bool Boolean value. Can be set to either true or false. The bool type usually contains 1 byte of data.

Related Tutorials