Posted in: C Language

What are Data Types – C Language

Different types of data that could be used in any language are referred to as data types.

Each variable in C has an associated data type. Each data type requires different amounts of memory and has some specific operations which can be performed over it. Let us briefly describe them one by one:

C language supports 3 different type of data types:

1.Primary data types:

These are fundamental data types in C namely integer(int), floating point(float), character(char) and void.

All c compilers supports five types of data types are as follows:

  • char: The most basic data type in C. It stores a single character and requires a single byte of memory in almost all compilers.
  • int: As the name suggests, an int variable is used to store an integer.
  • float: It is used to store decimal numbers (numbers with floating point value) with single precision.
  • double: It is used to store decimal numbers (numbers with floating point value) with double precision.

Every C compiler supports five primary data types:

2.Derived data types:

Derived data types are nothing but primary datatypes but a twisted or grouped together like arraystructure  and pointer.

3.User defined Data Type

C supports a feature known as type definition that allows the user to define an identifier that would represent an existing data type