C language is rich in its data types. C supports
several different types of data, each of which may be represented differently
within the computer memory. There are three cases of data types:
1. Basic data types (Primary or Fundamental) e.g.int,
char
2. Derived data types e.g. array, pointer, function
3. User defined data types e.g. structure, union,
enum
The basic data types are also k/a built in data
types. The basic data types are listed below. Typical memory requirements are
also given:
Data Types Description Typical Memory
Requirement
char single character 1
byte
int integer quantity 2
bytes
float floating-point
number 4 bytes (1 word)
double double-precision floating point number 8 bytes (2 word)
In order to provide some control over the range of numbers
and storage space, C has following classes: signed, unsigned, short, and long.
Types
Size
char or signed char 1
byte
unsigned char 1
byte
int 2 bytes
short int 1
byte
unsigned short int 1
byte
signed int 2
bytes
unsigned int 2
bytes
long int 4
bytes
signed long int 4
bytes
unsigned long int 4
bytes
float 4
bytes
double 8
bytes
long double 10 bytes
void is also a built-in data type used to specify the
type of function. The void type has no values.
Comments
Post a Comment