An open API service indexing awesome lists of open source software.

https://github.com/crazyguitar/cppcheatsheet

C/C++ Cheat Sheet
https://github.com/crazyguitar/cppcheatsheet

c cheatsheet cpp cpp20 cpp23 cuda rust

Last synced: 8 days ago
JSON representation

C/C++ Cheat Sheet

Awesome Lists containing this project

README

          

====================
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.

/cpp Skill
==========

This repository includes a comprehensive Claude Code skill that automatically provides C/C++ cheat sheet examples when you ask programming questions.

**Installation:**

.. code:: bash

# Install globally for Claude Code
mkdir -p ~/.claude/skills
cp -r skills ~/.claude/skills/cpp

# +The skill covers everything from basic syntax to advanced topics like
# GPU programming, system programming, debugging and so on.

Modern C Programming
====================

Core C language features from C11 to C23, including memory management, preprocessor
macros, GNU extensions, and build systems.

- `C Basics `_
- `Memory `_
- `Preprocessor & GNU Extensions `_
- `Makefile `_
- `X86 Assembly `_

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 `_
- `Resource Management `_
- `String `_
- `Container `_
- `Iterator `_
- `Template `_
- `Casting `_
- `Constexpr `_
- `Lambda `_
- `Concepts `_
- `Requires `_
- `Time `_
- `Smart Pointers `_
- `Return Value Optimization `_
- `Algorithm `_
- `Coroutine `_
- `Modules `_
- `CMake `_

System Programming
==================

POSIX system programming covering process management, file I/O, signals, network
sockets, threading, and inter-process communication.

- `Process `_
- `File `_
- `Signal `_
- `Socket `_
- `Thread `_
- `IPC `_

CUDA Programming
================

GPU programming with NVIDIA CUDA. Covers kernel basics, memory hierarchy, cooperative
groups, memory visibility, asynchronous pipelines, and multi-GPU communication.

- `CUDA Basics `_
- `CUDA C++ (libcu++) `_
- `Thrust `_
- `Cooperative Groups `_
- `Memory Visibility `_
- `CUDA Graph `_
- `Quantization `_
- `Pipelines `_
- `GPU-GPU Communication `_
- `NCCL `_
- `Hardware Topology `_

Bash & System Tools
===================

Command-line tools and shell scripting for system administration, networking,
and hardware inspection.

- `Bash `_
- `Operating System `_
- `Network `_
- `Hardware `_
- `GPU `_
- `Systemd `_

Debugging & Profiling
=====================

Tools for debugging, memory analysis, and performance profiling of C/C++ and
CUDA applications.

- `GDB `_
- `Valgrind `_
- `Sanitizers `_
- `Tracing `_
- `Perf `_
- `Nsight Systems `_

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 `_
- `Ownership & Borrowing `_
- `RAII & Drop `_
- `Strings `_
- `Collections `_
- `Iterators `_
- `Traits & Generics `_
- `Casting `_
- `Const Functions `_
- `Closures `_
- `Smart Pointers `_
- `Error Handling `_
- `Threads `_
- `Modules `_
- `FFI & C++ Bindings `_

Blog
====

Deep dives into advanced topics with detailed explanations, low-level implementations,
and working code examples.

- `Building NVSHMEM from Scratch: GPU-Initiated Networking `_