Thanks for Visiting here

Data Types
A data type specifies the type of data that a variable can store such as integer, floating, character, etc.There are the following data types in C language.
Sr.No. | Types & Description |
---|---|
1 | Basic Types They are arithmetic types and are further classified into: (a) integer types and (b) floating-point types. |
2 | Enumerated types They are again arithmetic types and they are used to define variables that can only assign certain discrete integer values throughout the program. |
3 | The type void The type specifier void indicates that no value is available. |
4 | Derived types They include (a) Pointer types, (b) Array types, (c) Structure types, (d) Union types and (e) Function types. |
The array types and structure types are referred collectively as the aggregate types. The type of a function specifies the type of the function's return value. We will see the basic types in the following section, where as other types will be covered in the upcoming chapters.
Basic types
Here's a table containing commonly used types in C programming for quick access.
Type | Size (bytes) | Format Specifier |
---|---|---|
int | at least 2, usually 4 | %d , %i |
char | 1 | %c |
float | 4 | %f |
double | 8 | %lf |
short int | 2 usually | %hd |
unsigned int | at least 2, usually 4 | %u |
long int | at least 4, usually 8 | %ld , %li |
long long int | at least 8 | %lld , %lli |
unsigned long int | at least 4 | %lu |
unsigned long long int | at least 8 | %llu |
signed char | 1 | %c |
unsigned char | 1 | %c |
long double | at least 10, usually 12 or 16 | %Lf |