cirosantilli/cpp-cheat logo

cirosantilli/cpp-cheat

Free

MOVING TO: https://github.com/cirosantilli/linux-kernel-module-cheat#userland-content SEE README. C, C++, POSIX and Linux system programming minimal examples. Asserts used wherever possible. Hello worlds for cool third party libraries and build systems. Cheatsheets, tutorials and mini-projects. 移至:h

FreeFree tier
Type
Open Source

About cirosantilli/cpp-cheat

This repository provides minimal examples for C, C++, POSIX, and Linux system programming, with asserts used wherever possible. It includes hello world programs for third-party libraries and build systems, along with cheatsheets, tutorials, and mini-projects. The repo is being migrated to https://github.com/cirosantilli/linux-kernel-module-cheat#userland-content for unified maintenance, but existing content remains accessible.

Key Features

Minimal executable examples for C, C++, POSIX, and Linux system programming
Asserts used wherever possible to ensure correctness
Hello world programs for third-party libraries: Boost, FFmpeg, OpenCV, Qt, SDL, GSL, CUDA, and more
Build system examples: make, CMake, SCons
Cheatsheets, tutorials, and mini-projects for learning
Cross-language examples: C from C++, C++ from C, Fortran from C, SWIG
Coverage of topics: POSIX API, OpenGL, GCC extensions, shared libraries, linker, GDB, and more

Pros & Cons

Pros
  • Extensive collection of minimal, focused examples covering a wide range of topics
  • Asserts used in examples to validate expected behavior and aid debugging
  • Covers both low-level system programming and high-level library usage
  • Open source and free to use, modify, and contribute to
  • Includes cross-language integration examples (C++, Python via SWIG, Fortran)
Cons
  • Repository is being moved to a new location; no active development on current content
  • Quality of examples varies; older files may be less polished or outdated
  • Not an AI tool; primarily a code reference repository

Best For

Learning C, C++, and Linux system programming through concise examplesQuick reference for POSIX and Linux API usageExploring how to interface C and C++ with other languagesSetting up and testing build systems (make, CMake, SCons)Integrating popular third-party libraries in small projects

FAQ

What is the purpose of this repository?
It provides minimal, self-contained examples for C, C++, POSIX, and Linux system programming, with asserts for correctness. It also includes hello-world programs for various third-party libraries and build systems.
Why is this repository moving?
The content is being migrated to https://github.com/cirosantilli/linux-kernel-module-cheat#userland-content to unify all system programming material into one maintainable repository with better testing and support for multiple CPU ISAs.
Is the repository still actively maintained?
No major new features will be added here. Only good or cleaned-up examples will be gradually migrated to the new repository.