==================== C/C++ Cheatsheet
.. image:: https://img.shields.io/badge/doc-pdf-blue :target: https://cppcheatsheet.readthedocs.io/_/downloads/en/latest/pdf/
This cheatsheet provides a curated collection of C and C++ code snippets covering modern language standards, system programming, and development tools. From basic syntax to advanced features like coroutines, templates, and memory management, each example is designed to be clear, practical, and ready to use. All code is tested and compiles cleanly, so you can focus on learning and adapting rather than debugging reference material.
Plugin
cppcheatsheet is available as a Claude Code plugin. Once installed, Claude automatically uses the cheat sheets to answer C/C++ questions — just ask naturally and the skill triggers based on context.
Installation
As a Claude Code plugin (recommended):
.. code-block:: bash
# Step 1: Add the marketplace
claude plugin marketplace add crazyguitar/cppcheatsheet
# Step 2: Install the plugin
claude plugin install cppcheatsheet@cppcheatsheet
Local testing (single session only):
.. code-block:: bash
claude --plugin-dir /path/to/cppcheatsheet
Manual installation (requires cloning the repo):
.. code-block:: bash
git clone https://github.com/crazyguitar/cppcheatsheet.git
mkdir -p ~/.claude/skills
cp -r cppcheatsheet/skills/cpp ~/.claude/skills/cpp
C/C++ Interview Cheatsheet
Curated C and C++ interview questions indexed by topic — each question links directly to the section of the cheat sheet that answers it. Use it for quick review before an interview, or to drill down on a specific area (RAII, move semantics, templates, concurrency, and more).
C/C++ Interview Cheatsheet <docs/notes/interview/index.rst>_
Modern C Programming
Core C language features from C11 to C23, including memory management, preprocessor macros, GNU extensions, and build systems.
C Basics <docs/notes/c/c_basic.rst>_Memory <docs/notes/c/c_memory.rst>_Preprocessor & GNU Extensions <docs/notes/c/c_macro.rst>_Makefile <docs/notes/c/make.rst>_X86 Assembly <docs/notes/c/asm.rst>_
Modern C++ Programming
Modern C++ features from C++11 to C++23. Covers resource management with RAII and smart pointers, generic programming with templates and concepts, functional patterns with lambdas, compile-time computation with constexpr, and asynchronous programming with coroutines.
C++ Basics <docs/notes/cpp/cpp_basic.rst>_Resource Management <docs/notes/cpp/cpp_raii.rst>_Move Semantics <docs/notes/cpp/cpp_move.rst>_String <docs/notes/cpp/cpp_string.rst>_Container <docs/notes/cpp/cpp_container.rst>_Iterator <docs/notes/cpp/cpp_iterator.rst>_Template <docs/notes/cpp/cpp_template.rst>_Casting <docs/notes/cpp/cpp_casting.rst>_Polymorphism <docs/notes/cpp/cpp_polymorphism.rst>_Type Erasure <docs/notes/cpp/cpp_type_erasure.rst>_Constexpr <docs/notes/cpp/cpp_constexpr.rst>_Lambda <docs/notes/cpp/cpp_lambda.rst>_Concepts <docs/notes/cpp/cpp_concepts.rst>_Requires <docs/notes/cpp/cpp_requires.rst>_Time <docs/notes/cpp/cpp_time.rst>_Smart Pointers <docs/notes/cpp/cpp_smartpointers.rst>_Return Value Optimization <docs/notes/cpp/cpp_rvo.rst>_Algorithm <docs/notes/cpp/cpp_algorithm.rst>_Coroutine <docs/notes/cpp/cpp_coroutine.rst>_Modules <docs/notes/cpp/cpp_modules.rst>_CMake <docs/notes/cpp/cpp_cmake.rst>_
System Programming
POSIX system programming covering process management, file I/O, signals, network sockets, threading, and inter-process communication.
Process <docs/notes/os/os_process.rst>_File <docs/notes/os/os_file.rst>_Signal <docs/notes/os/os_signal.rst>_Socket <docs/notes/os/os_socket.rst>_Thread <docs/notes/os/os_thread.rst>_IPC <docs/notes/os/os_ipc.rst>_
CUDA Programming
GPU programming with NVIDIA CUDA. Covers kernel basics, memory hierarchy, cooperative groups, memory visibility, asynchronous pipelines, and multi-GPU communication.
CUDA Basics <docs/notes/cuda/cuda_basics.rst>_CUDA C++ (libcu++) <docs/notes/cuda/cuda_cpp.rst>_Thrust <docs/notes/cuda/cuda_thrust.rst>_Cooperative Groups <docs/notes/cuda/cuda_coop_groups.rst>_Memory Visibility <docs/notes/cuda/cuda_memory_visibility.rst>_CUDA Graph <docs/notes/cuda/cuda_graph.rst>_Quantization <docs/notes/cuda/cuda_quantization.rst>_Pipelines <docs/notes/cuda/cuda_pipelines.rst>_GPU-GPU Communication <docs/notes/cuda/cuda_ipc.rst>_NCCL <docs/notes/cuda/cuda_nccl.rst>_Hardware Topology <docs/notes/cuda/cuda_hwloc.rst>_
Bash & System Tools
Command-line tools and shell scripting for system administration, networking, and hardware inspection.
Bash <docs/notes/tools/bash.rst>_Operating System <docs/notes/tools/os.rst>_Network <docs/notes/tools/net.rst>_Hardware <docs/notes/tools/hardware.rst>_GPU <docs/notes/tools/gpu.rst>_Systemd <docs/notes/tools/systemd.rst>_
Debugging & Profiling
Tools for debugging, memory analysis, and performance profiling of C/C++ and CUDA applications.
GDB <docs/notes/debug/gdb.rst>_Valgrind <docs/notes/debug/valgrind.rst>_Sanitizers <docs/notes/debug/sanitizers.rst>_Tracing <docs/notes/debug/tracing.rst>_Perf <docs/notes/debug/perf.rst>_Nsight Systems <docs/notes/debug/nsight.rst>_Binary Tools <docs/notes/debug/binary_tools.rst>_
Rust for C++ Developers
Rust programming guide for C++ developers. Maps C++ concepts to Rust equivalents with side-by-side code comparisons covering ownership, traits, error handling, smart pointers, and concurrency.
Basics <docs/notes/rust/rust_basic.rst>_Ownership & Borrowing <docs/notes/rust/rust_ownership.rst>_RAII & Drop <docs/notes/rust/rust_raii.rst>_Strings <docs/notes/rust/rust_string.rst>_Collections <docs/notes/rust/rust_container.rst>_Iterators <docs/notes/rust/rust_iterator.rst>_Traits & Generics <docs/notes/rust/rust_traits.rst>_Polymorphism <docs/notes/rust/rust_polymorphism.rst>_Casting <docs/notes/rust/rust_casting.rst>_Const Functions <docs/notes/rust/rust_constfn.rst>_Closures <docs/notes/rust/rust_closure.rst>_Smart Pointers <docs/notes/rust/rust_smartptr.rst>_Error Handling <docs/notes/rust/rust_error.rst>_Threads <docs/notes/rust/rust_thread.rst>_Macros <docs/notes/rust/rust_macros.rst>_Modules <docs/notes/rust/rust_modules.rst>_FFI & C++ Bindings <docs/notes/rust/rust_ffi.rst>_
Blog
Deep dives into advanced topics with detailed explanations, low-level implementations, and working code examples.
Building NVSHMEM from Scratch: GPU-Initiated Networking <docs/notes/blog/nvshmem.rst>_