C++ Variable Types

In this tutorial you will learn about the C++ Variable Types and its application with practical example.

C++ Variable Types

In C++, every variable we declare has specific type associated with it, type of a variable allows us to determines the size of memory space required to store value, the range of values it can hold; and the set of operations that can be performed on it. Variables can also be categorized based on their data type.

In C++, we can have following basic types of variable –

int :- These type of variables are used to store whole numbers.

char :- These type of variables are used to store single character.

bool :- These type of variables are used to store the truth values, which can be either True or False.

double :- These type of variables are used to store numbers that contain a decimal component (Double-precision).

float :- These type of variables are used to store numbers that contain a decimal component (Single-precision)

In this tutorial we have learn about the C++ Variable Types and its application with practical example. I hope you will like this tutorial.