Course Content
Programming in C
About Lesson

There are just a few basic data types in C:

char: a single byte, capable of holding one character in the local character set.

int: an integer, typically reflecting the natural size of integers on the host machine.

float: single-precision floating point.

double: double-precision floating point.

In addition, there are a number of qualifiers that can be applied to these basic data types. short and long apply to integers:

short int age;
long int salary;

In the above declaration, the word int can be(and usually is) omitted.
short is often 16 bits, long 32 bits and int is either 16 or 32 bits, depending on the machine.
The qualifier signed or unsigned may be applied to char or any integer. For instance, if chars are 8 bits, unsigned char variables have values between 0 and 255, while signed char variables have values between -128 and 127.
The type long double specifies extended-precision floating point. As with integers, the sizes of floating-point variables are implementation-defined.
The standard headers and contain symbolic constants for all of these sizes, example INT_MAX, INT_MIN, etc.

Scroll to Top