Fundamental data types and sizes used in C Programming
ANSI C supports four classes of data types
- Primary data types,
- User-defined data types,
- Derived data types,
- Empty data set.
All C compilers support four fundamental data types, namely Integer (int), character (char), floating point (float) and Double precision floating point (double). Many of them also offer extended data types such as long int and long double.
Size and range of Basic data types
Range of values
|char||– 128 to 127|
|int||– 32,768 to 32,767|
|float||3.4e – 38 to 3.4e + 38|
|double||1.7e – 308 to 1.7e + 308|
Generally, integer occupies one word of storage since the word sizes of machines vary (16 to 32 bits). If we use 16-bit word length, the size of an integer value is limited to – 32768 to 32767. 32-bit word length can store an integer ranging from – 2147 483 648 to 2147 483 647.
Size and range of Data type on 16-bits machine
|Char or signed char||8||– 128 to 127|
|unsigned char||8||0 to 255|
|int or signed int||16||– 32,768 to 32,767|
|unsigned int||16||0 to 65535|
|short int or signed short int||8||– 128 to 127|
|unsigned short int||8||0 to 255|
|long int or signed long int||32||-2147483648 to 2147483647|
|unsigned long int||32||0 to 4294967295|
|float||32||3.4E – 38 to 3.4E + 38|
|double||64||1.7E-308 to 1.7E + 308|
|long double||80||3.4E – 4932 to 1.1E + 4932|
Click here: for more c tutorials
The post Fundamental data types and sizes used in C Programming appeared first on All In One Tuts.
This post first appeared on All In One Tuts | Tech Tutorials And Videos | Tech, please read the originial post: here