C types tell the compiler how much memory a value needs and how to treat it.
Direct answer
The basic C types are char for characters, int for whole numbers, float for single-precision decimals and double for double-precision decimals. Modifiers like short, long and unsigned change the range. Sizes depend on the platform, so use sizeof to check.
Table
| Type | Typical use | Common size |
|---|---|---|
char | single character | 1 byte |
int | whole numbers | 4 bytes |
float | decimals | 4 bytes |
double | precise decimals | 8 bytes |
long long | large integers | 8 bytes |
Check sizes
#include <stdio.h>
int main(void) {
printf("int: %zu\n", sizeof(int));
printf("double: %zu\n", sizeof(double));
return 0;
}
Cautions
- Integer division truncates:
5 / 2is2. - Floating-point numbers are approximate.
- Mixing signed and unsigned can surprise you.
Where Teyro fits
Teyro's C for Beginners course turns this into short lessons you can play in a few minutes a day. It has 78 lessons, and you can start free.
The bottom line
Choose the smallest type that fits the data safely.


