Variable Types:
There are a number of ‘built-in’ data types in C. These are listed below. Where a
shorter version of the type name exists, this is given in brackets; essentially the base
type int is implicit whenever short , long, or unsigned are used.
- short int (short)
- unsigned short int (unsigned short )
- char
- unsigned char
- signed char
- int
- unsigned int (unsigned )
- long int (long)
- unsigned long int (unsigned long )
- float
- double
- long double
The range of values that can be stored in variables of these types will depend on the
compiler and computer that you are using, but on an IBM PCs and the Borland Turbo
C compiler the ranges are:
- short int -128 ® 127 (1 byte)
- unsigned short int 0 ® 255 (1 byte)
- char 0 ® 255 or -128 ® +127 2 (1 byte)
- unsigned char 0 ® 255 (1 byte)
- signed char -128 ® 127 (1 byte)
- int -32,768 ® +32,767 (2 bytes)
- unsigned int 0 ® +65,535 (2 bytes)
- long int -2,147,483,648 ® +2,147,483,647 (4 bytes)
- unsigned long int 0 ® 4,294,967,295 (4 bytes)
- float single precision floating point (4 bytes)
- double double precision floating point (8 bytes)
- long doubl e extended precision floating point (10 bytes)
No comments:
Post a Comment