C Quick Reference
C essentials: types, printf/scanf, arrays, strings, pointers, structs, memory, files and compiling.
6 sections · 33 snippets · updated Oct 14, 2026
Click any snippet to copy it.
Basics
Program structure and types.
TaskCode
- Hello world
- Variables
- Constant
- Booleans
- Print formatted
- Read input
- Size of a type
Control flow
Conditions and loops.
TaskCode
- If / else
- Switch
- For / while
- Do-while
Arrays & strings
Fixed-size data and text.
TaskCode
- Array
- String
- String length / copy
- Compare strings
- Concatenate
- Format into a string
- Number from string
Pointers & memory
Addresses and the heap.
TaskCode
- Pointer basics
- Pass by pointer
- Allocate memory
- Zeroed / resized memory
- Free memory
Structs & functions
Grouping data and code.
TaskCode
- Struct
- Typedef
- Member access
- Function
- Prototype (declare before use)
- Enum
Files & compiling
I/O and building.
TaskCode
- Write a file
- Read lines
- Compile and run
- Command-line arguments