C data typesPritesh
What is Data Type in C Programming ?
- A Data Type is a Type of Data.
- Data Type is a Data Storage Format that can contain a Specific Type or Range of Values.
- When computer programs store data in variables, each variable must be assigned a specific data type.
Some of the Data Types Supported by C :
|Integer Data Type||int||Stores the Integer Value|
|Float Data Type||float||Stores the Floating Point Value|
|Character Data Type||char||Stores the Single Character Value|
|Long Data Type||long||Stores the Long range Integer Value|
|Double Data Type||double||Stores the long range Floating Value|
- Whenever we declare variable in Computer’s memory, Computer must know the type of the data to be stored inside the memory.
- If we need to store the single character then the size of memory occupied will be different than storing the single integer number.
- The memory in our computers is organized in bytes. A byte is the minimum amount of memory that we can manage in C.
- 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 Type||Borland C/C++ Compiler||Visual C++|
|Integer||2 Bytes||4 bytes|
|Float||4 Bytes||4 Bytes|
|Character||1 Byte||1 Byte|
|Long||4 Byte||8 Byte|