Data types of the variables

As the name suggests, data type represents the name of the type of data. In C++, when creating any variable, we need to specify its data type so that the compiler knows how much memory should be allocated for that particular variable. Such a language, where the programmer needs to tell the compiler the data type of the variable at the compile time, is called a statically-typed language.

In the previous chapter, we only used the int data type that stores only an integer value. Let’s learn about the primitive data typesdata types that are native to the language and do not require user definition in C++.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy