C/C++ Roadmap
A short roadmap to learn and improve C/C++ for systems programming, firmware, and high-performance tools.
1. C Core & Memory Model
- Master fixed-width integer types (
stdint.h:uint8_t,uint32_t), struct alignment/padding, and endianness. - Understand pointers, array decay, function pointers, stack vs. heap (
malloc/free), and object lifetime. - Know common Undefined Behavior traps: buffer overflow, use-after-free, null dereference, and signed integer overflow.
2. Systems & Firmware C
- Use bitwise operations (
&,|,^,~,<<,>>) for hardware registers and binary protocols. - Understand
volatile,const,static,extern, and how linker scripts and memory maps work. - Practice Linux POSIX APIs (
open,read,write,ioctl,poll/epoll,pthread, sockets).
3. Modern C++ (C++17 / C++20)
- Use RAII and smart pointers (
std::unique_ptr,std::shared_ptr) instead of manualnew/delete. - Use standard containers (
std::vector,std::array,std::string_view,std::span,std::unordered_map). - Learn move semantics, lambdas,
std::optional,std::expected(C++23),std::thread/std::mutex, andconstexpr. - See also: C/C++ Cheatsheet.
4. Build Systems, Testing & Debugging
- Use CMake (target-based
CMakeLists.txt,CMakePresets.json) and basicMakefile; manage packages withvcpkgorFetchContent. - Debug with GDB and catch memory issues with AddressSanitizer (
-fsanitize=address,undefined) and Valgrind. - Add
clang-format,clang-tidy, and unit tests (Catch2,GoogleTest, orUnityfor embedded C).
Further Reading
- cppreference.com — The most accurate C and C++ reference.
- Learn C++ (learncpp.com) — Free, structured Modern C++ guide.
- C++ Core Guidelines — Best practices for safe, clean C++.
- Beej's Guide to C Programming — Clear, practical C programming book.
- Modern CMake — Practical guide to modern CMake.