Chuyển tới nội dung chính

C/C++ Roadmap

Lộ trình ngắn gọn để làm quen và nâng cao kỹ năng C/C++ cho lập trình hệ thống, firmware và công cụ hiệu năng cao.

1. C Core & Memory Model​

  • Hiểu rõ kiểu dữ liệu kích thước cố định (stdint.h: uint8_t, uint32_t), struct alignment/padding và endianness.
  • Nắm chắc pointer, array decay, function pointer, stack vs. heap (malloc/free) và vòng đời bộ nhớ.
  • Biết các lỗi phổ biến (Undefined Behavior): buffer overflow, use-after-free, null dereference, integer overflow.

2. Systems & Firmware C​

  • Thao tác bit (&, |, ^, ~, <<, >>) cho thanh ghi phần cứng và giao thức truyền thông.
  • Hiểu từ khóa volatile, const, static, extern và cách linker script / memory map hoạt động.
  • Làm quen POSIX API trên Linux (open, read, write, ioctl, poll/epoll, pthread, socket).

3. Modern C++ (C++17 / C++20)​

  • Nắm RAII và smart pointers (std::unique_ptr, std::shared_ptr) thay cho new/delete thủ công.
  • Dùng thành thạo STL container (std::vector, std::array, std::string_view, std::span, std::unordered_map).
  • Làm quen move semantics, lambda, std::optional, std::expected (C++23), std::thread/std::mutex và constexpr.
  • Xem thêm: C/C++ Cheatsheet.

4. Build Systems, Testing & Debugging​

  • Thành thạo CMake (target-based CMakeLists.txt, CMakePresets.json) và Makefile cơ bản; quản lý dependency bằng vcpkg hoặc FetchContent.
  • Debug bằng GDB, kiểm tra lỗi bộ nhớ bằng AddressSanitizer (-fsanitize=address,undefined) và Valgrind.
  • Dùng clang-format, clang-tidy và unit test (Catch2, GoogleTest, hoặc Unity cho C nhúng).

Tham khảo để học sâu hơn​