types
int port = 443;
long big = 1'000'000;
unsigned char byte = 0x2A;
The digit separator is a C23 feature Older compilers reject it
Integers
char , short , int , long , long long
Each has a signed and unsigned form
Sizes vary by platform, so do not assume an int is four bytes
#include <stdint.h>
uint32_t exact = 443;
Fixed width types remove the guesswork
Floating point
float , double , long double
Use double by default
float is for storage constrained work and needs care with precision
bool
#include <stdbool.h>
bool ready = true;
C23 makes bool , true , and false keywords
Older code uses <stdbool.h>
Both forms appear in real codebases
Next
Operators in 03 operators
Posted