Introduction to Data Types:
For learning C programming we have to familiar with several types of data.
There are five fundamental datatypes,which are all supported in any c compilers.
They are
1) Integer (int) - for integer type data.
2) Float (float) - for floating point number.
3) Character (char) - for a single character. (included spacial character)
4) Double (double) - for a huge floating point number.
5) Void (void) - for a void type variable.
We can derive some other data type from these five fundamental datatypes.
these derived datatypes are short integer,signed integer, unsigned integer etc.
Integer:
1. signed int 1. unsigned int
2. signed short int 2. unsigned short int
3. signed long int 3. unsigned long int
Character: Float:
1. char 1. float
2. signed char 2. double
3. unsigned char 3. long double
Now one thing is to be remembered. The range of several data type depends upon compiler.
i.e: For a 16 bit compiler the range of an integer constant is -32768 to +32767.
for a 32 bit compiler this range is -2147483648 to +2147483647.
Size of data types is also depend upon compiler.
Compiler short Int long
16 bit 2 2 4
32 bit 2 4 4