{"id":17290544,"url":"https://github.com/crazyguitar/cppcheatsheet","last_synced_at":"2026-02-14T02:01:58.789Z","repository":{"id":37077614,"uuid":"53253009","full_name":"crazyguitar/cppcheatsheet","owner":"crazyguitar","description":"C/C++ Cheat Sheet","archived":false,"fork":false,"pushed_at":"2026-02-12T18:28:28.000Z","size":5896,"stargazers_count":256,"open_issues_count":1,"forks_count":48,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-02-13T02:02:09.453Z","etag":null,"topics":["c","cheatsheet","cpp","cpp20","cpp23","cuda","rust"],"latest_commit_sha":null,"homepage":"https://cppcheatsheet.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crazyguitar.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"crazyguitar"}},"created_at":"2016-03-06T12:10:01.000Z","updated_at":"2026-02-12T18:28:46.000Z","dependencies_parsed_at":"2024-10-31T16:05:09.381Z","dependency_job_id":"0240502e-7a8e-4cc2-b087-2d18de430ba7","html_url":"https://github.com/crazyguitar/cppcheatsheet","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/crazyguitar/cppcheatsheet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyguitar%2Fcppcheatsheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyguitar%2Fcppcheatsheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyguitar%2Fcppcheatsheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyguitar%2Fcppcheatsheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazyguitar","download_url":"https://codeload.github.com/crazyguitar/cppcheatsheet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyguitar%2Fcppcheatsheet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29431593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T22:20:51.549Z","status":"online","status_checked_at":"2026-02-14T02:00:07.626Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cheatsheet","cpp","cpp20","cpp23","cuda","rust"],"created_at":"2024-10-15T10:38:32.624Z","updated_at":"2026-02-14T02:01:58.784Z","avatar_url":"https://github.com/crazyguitar.png","language":"C++","readme":"====================\nC/C++ Cheatsheet\n====================\n\n.. image:: https://img.shields.io/badge/doc-pdf-blue\n   :target: https://cppcheatsheet.readthedocs.io/_/downloads/en/latest/pdf/\n\nThis 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.\n\n/cpp Skill\n==========\n\nThis repository includes a comprehensive Claude Code skill that automatically provides C/C++ cheat sheet examples when you ask programming questions.\n\n**Installation:**\n\n.. code:: bash\n\n    # Install globally for Claude Code\n    mkdir -p ~/.claude/skills\n    cp -r skills ~/.claude/skills/cpp\n\n    # +The skill covers everything from basic syntax to advanced topics like\n    # GPU programming, system programming, debugging and so on.\n\nModern C Programming\n====================\n\nCore C language features from C11 to C23, including memory management, preprocessor\nmacros, GNU extensions, and build systems.\n\n- `C Basics \u003cdocs/notes/c/c_basic.rst\u003e`_\n- `Memory \u003cdocs/notes/c/c_memory.rst\u003e`_\n- `Preprocessor \u0026 GNU Extensions \u003cdocs/notes/c/c_macro.rst\u003e`_\n- `Makefile \u003cdocs/notes/c/make.rst\u003e`_\n- `X86 Assembly \u003cdocs/notes/c/asm.rst\u003e`_\n\nModern C++ Programming\n======================\n\nModern C++ features from C++11 to C++23. Covers resource management with RAII and\nsmart pointers, generic programming with templates and concepts, functional patterns\nwith lambdas, compile-time computation with constexpr, and asynchronous programming\nwith coroutines.\n\n- `C++ Basics \u003cdocs/notes/cpp/cpp_basic.rst\u003e`_\n- `Resource Management \u003cdocs/notes/cpp/cpp_raii.rst\u003e`_\n- `String \u003cdocs/notes/cpp/cpp_string.rst\u003e`_\n- `Container \u003cdocs/notes/cpp/cpp_container.rst\u003e`_\n- `Iterator \u003cdocs/notes/cpp/cpp_iterator.rst\u003e`_\n- `Template \u003cdocs/notes/cpp/cpp_template.rst\u003e`_\n- `Casting \u003cdocs/notes/cpp/cpp_casting.rst\u003e`_\n- `Constexpr \u003cdocs/notes/cpp/cpp_constexpr.rst\u003e`_\n- `Lambda \u003cdocs/notes/cpp/cpp_lambda.rst\u003e`_\n- `Concepts \u003cdocs/notes/cpp/cpp_concepts.rst\u003e`_\n- `Requires \u003cdocs/notes/cpp/cpp_requires.rst\u003e`_\n- `Time \u003cdocs/notes/cpp/cpp_time.rst\u003e`_\n- `Smart Pointers \u003cdocs/notes/cpp/cpp_smartpointers.rst\u003e`_\n- `Return Value Optimization \u003cdocs/notes/cpp/cpp_rvo.rst\u003e`_\n- `Algorithm \u003cdocs/notes/cpp/cpp_algorithm.rst\u003e`_\n- `Coroutine \u003cdocs/notes/cpp/cpp_coroutine.rst\u003e`_\n- `Modules \u003cdocs/notes/cpp/cpp_modules.rst\u003e`_\n- `CMake \u003cdocs/notes/cpp/cpp_cmake.rst\u003e`_\n\nSystem Programming\n==================\n\nPOSIX system programming covering process management, file I/O, signals, network\nsockets, threading, and inter-process communication.\n\n- `Process \u003cdocs/notes/os/os_process.rst\u003e`_\n- `File \u003cdocs/notes/os/os_file.rst\u003e`_\n- `Signal \u003cdocs/notes/os/os_signal.rst\u003e`_\n- `Socket \u003cdocs/notes/os/os_socket.rst\u003e`_\n- `Thread \u003cdocs/notes/os/os_thread.rst\u003e`_\n- `IPC \u003cdocs/notes/os/os_ipc.rst\u003e`_\n\nCUDA Programming\n================\n\nGPU programming with NVIDIA CUDA. Covers kernel basics, memory hierarchy, cooperative\ngroups, memory visibility, asynchronous pipelines, and multi-GPU communication.\n\n- `CUDA Basics \u003cdocs/notes/cuda/cuda_basics.rst\u003e`_\n- `CUDA C++ (libcu++) \u003cdocs/notes/cuda/cuda_cpp.rst\u003e`_\n- `Thrust \u003cdocs/notes/cuda/cuda_thrust.rst\u003e`_\n- `Cooperative Groups \u003cdocs/notes/cuda/cuda_coop_groups.rst\u003e`_\n- `Memory Visibility \u003cdocs/notes/cuda/cuda_memory_visibility.rst\u003e`_\n- `CUDA Graph \u003cdocs/notes/cuda/cuda_graph.rst\u003e`_\n- `Quantization \u003cdocs/notes/cuda/cuda_quantization.rst\u003e`_\n- `Pipelines \u003cdocs/notes/cuda/cuda_pipelines.rst\u003e`_\n- `GPU-GPU Communication \u003cdocs/notes/cuda/cuda_ipc.rst\u003e`_\n- `NCCL \u003cdocs/notes/cuda/cuda_nccl.rst\u003e`_\n- `Hardware Topology \u003cdocs/notes/cuda/cuda_hwloc.rst\u003e`_\n\nBash \u0026 System Tools\n===================\n\nCommand-line tools and shell scripting for system administration, networking,\nand hardware inspection.\n\n- `Bash \u003cdocs/notes/tools/bash.rst\u003e`_\n- `Operating System \u003cdocs/notes/tools/os.rst\u003e`_\n- `Network \u003cdocs/notes/tools/net.rst\u003e`_\n- `Hardware \u003cdocs/notes/tools/hardware.rst\u003e`_\n- `GPU \u003cdocs/notes/tools/gpu.rst\u003e`_\n- `Systemd \u003cdocs/notes/tools/systemd.rst\u003e`_\n\nDebugging \u0026 Profiling\n=====================\n\nTools for debugging, memory analysis, and performance profiling of C/C++ and\nCUDA applications.\n\n- `GDB \u003cdocs/notes/debug/gdb.rst\u003e`_\n- `Valgrind \u003cdocs/notes/debug/valgrind.rst\u003e`_\n- `Sanitizers \u003cdocs/notes/debug/sanitizers.rst\u003e`_\n- `Tracing \u003cdocs/notes/debug/tracing.rst\u003e`_\n- `Perf \u003cdocs/notes/debug/perf.rst\u003e`_\n- `Nsight Systems \u003cdocs/notes/debug/nsight.rst\u003e`_\n\nRust for C++ Developers\n=======================\n\nRust programming guide for C++ developers. Maps C++ concepts to Rust equivalents\nwith side-by-side code comparisons covering ownership, traits, error handling,\nsmart pointers, and concurrency.\n\n- `Basics \u003cdocs/notes/rust/rust_basic.rst\u003e`_\n- `Ownership \u0026 Borrowing \u003cdocs/notes/rust/rust_ownership.rst\u003e`_\n- `RAII \u0026 Drop \u003cdocs/notes/rust/rust_raii.rst\u003e`_\n- `Strings \u003cdocs/notes/rust/rust_string.rst\u003e`_\n- `Collections \u003cdocs/notes/rust/rust_container.rst\u003e`_\n- `Iterators \u003cdocs/notes/rust/rust_iterator.rst\u003e`_\n- `Traits \u0026 Generics \u003cdocs/notes/rust/rust_traits.rst\u003e`_\n- `Casting \u003cdocs/notes/rust/rust_casting.rst\u003e`_\n- `Const Functions \u003cdocs/notes/rust/rust_constfn.rst\u003e`_\n- `Closures \u003cdocs/notes/rust/rust_closure.rst\u003e`_\n- `Smart Pointers \u003cdocs/notes/rust/rust_smartptr.rst\u003e`_\n- `Error Handling \u003cdocs/notes/rust/rust_error.rst\u003e`_\n- `Threads \u003cdocs/notes/rust/rust_thread.rst\u003e`_\n- `Modules \u003cdocs/notes/rust/rust_modules.rst\u003e`_\n- `FFI \u0026 C++ Bindings \u003cdocs/notes/rust/rust_ffi.rst\u003e`_\n\nBlog\n====\n\nDeep dives into advanced topics with detailed explanations, low-level implementations,\nand working code examples.\n\n- `Building NVSHMEM from Scratch: GPU-Initiated Networking \u003cdocs/notes/blog/rdma.rst\u003e`_\n","funding_links":["https://github.com/sponsors/crazyguitar"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazyguitar%2Fcppcheatsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazyguitar%2Fcppcheatsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazyguitar%2Fcppcheatsheet/lists"}