C data types

What is Data Type in C Programming ?

  1. A Data Type is a Type of Data.
  2. Data Type is a Data Storage Format that can contain a Specific Type or Range of Values.
  3. When computer programs store data in variables, each variable must be assigned a specific data type.

Some of the Data Types Supported by C :

Data TypekeywordDescription
Integer Data TypeintStores the Integer Value
Float Data TypefloatStores the Floating Point Value
Character Data TypecharStores the Single Character Value
Long Data TypelongStores the Long range Integer Value
Double Data TypedoubleStores the long range Floating Value

Explanation :

  1. Whenever we declare variable in Computer’s memory, Computer must know the type of the data to be stored inside the memory.
  2. If we need to store the single character then the size of memory occupied will be different than storing the single integer number.
  3. The memory in our computers is organized in bytes. A byte is the minimum amount of memory that we can manage in C.
  4. A byte can store a relatively small amount of data one single character or a small integer (generally an integer between 0 and 255).

Re-commanded Readings : Data Type

Size Required to Store Variable of Different Data Types

Data TypeBorland C/C++ CompilerVisual C++
Integer2 Bytes4 bytes
Float4 Bytes4 Bytes
Character1 Byte1 Byte
Long4 Byte8 Byte