Data Types and Sizes

Get familiar with all the data types used in C.

To define a variable, we must specify its data type. The data type of a variable indicates what kind of data can be assigned to it. It also impacts how much memory will be allocated for storing the data in that variable.

Basic data types in C

There are eight basic data types in C. We describe these and the number of bytes required to store a value of each type in the table below.

However, do note that the C standard does not specify the exact number of bytes to be used for a data type—it specifies a range of values instead. Because of this and the differences in the underlying machine architecture, a few data types take up different amounts of space on different platforms.

Create a free account to access the full course.

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