A data type tells the compiler how much memory a value uses and how to interpret its bits. The basic types are char, int, float, double, and the modifiers short, long, signed, and unsigned. Sizes depend on the platform; use sizeof to check them.
Remember
char c = 'A'; /* 1 byte */
int i = 42; /* usually 4 bytes */
float f = 3.5f; /* usually 4 bytes */
double d = 3.14159; /* usually 8 bytes */
unsigned int u = 7u; /* no negative values */
Reference
Cheat Sheet
Keep these facts handy while you work with Data Types in C.
Topic
Detail
char
Small integer, usually a character, 1 byte
int
Natural integer size, at least 16 bits (usually 32)
float / double
Single / double precision floating point
Check size
sizeof(type) returns a size_t
Code
C Examples
Compile each example with gcc file.c -std=c11 -Wall -o out. Next: Type Conversion.
Example 1 — Sizes of the basic types
Print sizeof for each type on a typical 64-bit system.