FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Allocate a zeroed array
Check calloc, use the allocation, and release it in C.
C✓ Tested
Format a decimal value
Print two fractional digits with C printf.
C✓ Tested
Parse an integer with validation
Validate range and trailing characters when parsing a C integer with strtol.
C✓ Tested
Set and test bit flags
Use unsigned masks to combine and test C flags.
C✓ Tested
Swap two integers
Use a temporary value to swap C integers without arithmetic overflow.
C✓ Tested