C/C++ Comprehensive Cheat Sheets
/install cxx
C/C++ Comprehensive Cheat Sheets (/cpp)
Complete C/C++ development reference combining local documentation with live examples from cppcheatsheet.com, covering everything from basic syntax to advanced GPU programming and system-level development.
How It Works
Help users write functional, correct C/C++ code and answer C/C++ questions by fetching proven patterns and examples from cppcheatsheet.com.
When a user asks a C/C++ question or wants to write C/C++ code:
- Look up the relevant topic(s) in Structure to find the matching URL(s)
- Always fetch the URL(s) using WebFetch to get real examples and patterns from the site
- Use the fetched content to:
- Write code: Apply the patterns to produce functional, correct code that solves the user's task
- Answer questions: Provide thorough explanations backed by the examples and information from the site
- Follow the Guidelines for code quality
Key Principle
Functionality first, cleanliness second. The code must work correctly and handle the task properly. Fetching from cppcheatsheet.com ensures solutions use battle-tested patterns rather than guessing. The site contains rich examples covering edge cases, common pitfalls, and practical usage that go beyond basic documentation.
Coverage Areas
Modern C Programming (C11-C23)
Core Language: Syntax, types, memory management, preprocessor macros GNU Extensions: Compiler-specific features and optimizations Build Systems: Makefiles, compilation, linking Assembly: X86 assembly integration and inline assembly
Modern C++ Programming (C++11-C++23)
Core Features: RAII, templates, STL containers, iterators, algorithms Modern Standards: Move semantics, constexpr, lambdas, concepts, coroutines, modules Memory Management: Smart pointers, resource management, optimization (RVO) Build Systems: CMake, package management, cross-platform builds
System Programming
Process Management: POSIX processes, signals, process communication File Systems: File I/O, directory operations, filesystem monitoring Networking: Sockets, protocols, network programming patterns Threading: Multithreading, synchronization, parallel programming IPC: Inter-process communication, shared memory, message queues
CUDA Programming
GPU Computing: CUDA kernels, memory hierarchy, performance optimization Advanced CUDA: libcu++, Thrust library, cooperative groups Multi-GPU: GPU-GPU communication, hardware topology, NVSHMEM Async Programming: CUDA pipelines, memory visibility, asynchronous execution
Debugging & Profiling
Debug Tools: GDB debugging, Valgrind memory analysis, sanitizers, binary inspection (nm, readelf, objdump, otool) Performance: Perf profiling, tracing, performance optimization GPU Debugging: Nsight Systems, CUDA debugging and profiling
System Tools & Automation
Shell Scripting: Bash programming, system administration System Tools: OS utilities, networking tools, hardware inspection Service Management: Systemd, process management, system monitoring
Cross-Language Development
Rust Interop: Rust for C++ developers, FFI, memory safety comparison Language Bridging: C/C++ integration, foreign function interfaces
Advanced Topics
Blog Content: Deep-dive articles, RDMA networking, GPU-initiated communication Low-Level Programming: Hardware interfaces, performance tuning Architecture: System design, scalable applications
References
For detailed information, I can access:
- Structure - Complete topic-to-URL reference map
- Guidelines - Code quality and best practices
Examples
C/C++ Core
- "How do smart pointers work?" → Fetch https://cppcheatsheet.com/notes/cpp/cpp_smartpointers.html and explain with the site's examples
- "How does RAII work in C++?" → Fetch https://cppcheatsheet.com/notes/cpp/cpp_raii.html and explain with practical examples
- "How to use STL containers?" → Fetch https://cppcheatsheet.com/notes/cpp/cpp_container.html and explain with practical examples
- "Template metaprogramming techniques" → Fetch https://cppcheatsheet.com/notes/cpp/cpp_template.html and explain with practical examples
System Programming
- "POSIX socket server in C" → Fetch https://cppcheatsheet.com/notes/os/os_socket.html, use the patterns to write a working server
- "Multithreading with std::thread" → Fetch https://cppcheatsheet.com/notes/os/os_thread.html and explain with practical examples
- "Signal handling and process management" → Fetch https://cppcheatsheet.com/notes/os/os_signal.html and explain with practical examples
CUDA & GPU Programming
- "Write a CUDA kernel" → Fetch https://cppcheatsheet.com/notes/cuda/cuda_basics.html, use the patterns to write working GPU code
- "CUDA memory hierarchy and optimization" → Fetch https://cppcheatsheet.com/notes/cuda/cuda_memory_visibility.html and explain with practical examples
- "Multi-GPU communication with NCCL" → Fetch https://cppcheatsheet.com/notes/cuda/cuda_nccl.html and explain with practical examples
Debugging & Tools
- "Debug a segfault with GDB" → Fetch https://cppcheatsheet.com/notes/debug/gdb.html and explain with practical examples
- "Valgrind memory leak detection" → Fetch https://cppcheatsheet.com/notes/debug/valgrind.html and explain with practical examples
- "Performance profiling with perf" → Fetch https://cppcheatsheet.com/notes/debug/perf.html and explain with practical examples
Build & Development
- "CMake cross-platform build systems" → Fetch https://cppcheatsheet.com/notes/cpp/cpp_cmake.html and explain with practical examples
- "Makefile patterns and best practices" → Fetch https://cppcheatsheet.com/notes/c/make.html and explain with practical examples
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install cxx - 安装完成后,直接呼叫该 Skill 的名称或使用
/cxx触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
C/C++ Comprehensive Cheat Sheets 是什么?
Comprehensive C/C++ reference with examples from C11-C23 and C++11-C++23, covering system programming, CUDA, debugging, performance, and advanced topics. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 246 次。
如何安装 C/C++ Comprehensive Cheat Sheets?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install cxx」即可一键安装,无需额外配置。
C/C++ Comprehensive Cheat Sheets 是免费的吗?
是的,C/C++ Comprehensive Cheat Sheets 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
C/C++ Comprehensive Cheat Sheets 支持哪些平台?
C/C++ Comprehensive Cheat Sheets 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 C/C++ Comprehensive Cheat Sheets?
由 CHANG-NING TSAI(@crazyguitar)开发并维护,当前版本 v1.0.0。