Data Type
Data Type
A data type in C refers to the type of data used to store the information.
In general terms, a data type is an attribute that tells a computer how
to interpret the value.
Classification of C Data Types
Basic Data Types
The basic data types are integer-based and floating-point based.
The memory size of the basic data types may change according to
32 or 64-bit operating system.
Following are the examples of some very common data types used in C:
char: The most basic data type in C. It stores a single character and requires
a single byte of memory in almost all compilers.
float: It is used to store decimal numbers (numbers with floating point value)
with single precision.
A derived data type won’t typically create a new data type – but
would add various new functionalities to the existing ones
instead.
Types of Derived Data Types in C
But here, the memory that we allocate to the largest data type gets
reused for all the other types present in the group.
5. Structures –
It is mainly used to assign names to integral constants, the names make a program easy
to read and maintain.
Void Data Type
The void data type is an empty data type that refers to an object that does not
have a value of any type.
Here are the common uses of void data type. When it is used as a function return
type.