C and C++
From pointers and undefined behaviour to concepts, ranges and coroutines, from a bare-metal STM32 to a database engine built from scratch, the two languages and their ecosystem as told through the free samples of the Leanpub books about C and C++.
Created from the free samples of 28 Leanpub books and the descriptions and tables of contents of 30 more, with every source cited.
C is a small, compiled, procedural language with direct access to memory through pointers, written at Bell Labs in the early 1970s so that Unix could be rewritten in something other than assembly. C++ began at the end of that decade as an extension of C with classes, and grew templates, exceptions and a large standard library while keeping C's model of the machine, so that most C still compiles as C++. One source frames C as the language of university courses on computing systems, architecture and operating systems, where interpreted languages hide how memory and systems work;[5] another, written for engineers moving into embedded or safety-critical work, ties each chapter of C to a real failure, from Therac-25 to Heartbleed.[4] C++ had one standard, C++98, for thirteen years, with C++03 as a bug-fix release; C++11 ran to more than 1,300 pages and changed the language, and since then the committee has delivered a standard every three years.[11][12]
Today the two languages share a territory the sources map in three parts. The modern C++ standards, C++11 through C++23, are the subject of most of the library's books: the four large features of C++20, concepts, ranges, coroutines and modules, each get their own treatment,[16] and C++23, at more than 2,100 pages, lets a program replace its headers with a single import of the standard library.[11] Embedded systems are the second part, and the most-bought books in the category are about hardware: the STM32 portfolio, which one source says has grown from nine families to eighteen and more than 1,200 part numbers since 2015,[41] the Raspberry Pi RP2040, announced in January 2021 with two Cortex-M0+ cores and a programmable I/O block,[44] and the Espressif chips that one author programmed in C after decades away from the language.[45] The third part is systems built from scratch, where a database engine, a Redis clone and an LLM inference engine are the vehicles for learning the language as it is used.
This article follows the subject from the languages outward: where to begin, the history, C itself, modern C++ standard by standard, writing C++ well, concurrency and systems projects, embedded systems, the tools around the code, and practice and interviews. Its sources are the free samples of the Leanpub books listed at the end, with the descriptions and tables of contents of the books whose samples were not available, and every claim that rests on a source is cited to it.
Where to start
A reader with no programming at all has two paths. C++ Algorithmic Mastery: 1000 Challenges from Beginner to Legendary opens with a volume that assumes nothing and takes the reader from printing a line of output to arrays in 120 fully solved problems, each with a hint, a solution, its complexity and an explanation; its about text says the book was produced with AI assistance and human review.[1] Programming with C and C++ teaches C first and C++ second, from Hello World, for novices aiming at an intermediate level; its author says advanced programmers will gain little from it.[3] For C on its own, C From Scratch requires no prior C and defines the mathematics, the data structures and the tests before the code,[4] Welcome to C is a short textbook for students who already have a semester or two of Java,[5] and Build Your Own Lisp learns the language by building a small Lisp interpreter.[6] Less Confusing C++ Part 1 is a C++ primer for the Indian CBSE grade 11 syllabus and should be read as one: it uses the Turbo C++ dialect taught in those schools, with iostream.h and void main, and the author himself says that modern C++ in a current IDE is a much more beautiful language than the school version suggests.[7]
A working C++ developer catching up has the standards guides. C++17 in Detail is written for developers with at least essential C++11/14 experience and supplies the background where needed,[12] and the three Complete Guides, C++17 - The Complete Guide, C++20 - The Complete Guide and C++23 - The Complete Guide, each assume existing C++ and open with a section on what to know before reading.[13][14][15] Programming with C++20 needs only C++11 knowledge and introduces later features where they are required,[17] and C++20 pairs a snippet-only overview chapter with a detailed reference.[16] The C++ Standard Library assumes core C++ is already known, and its author says a newcomer should start with a textbook on the language before it.[11]
The specialist books say plainly what they assume. Concurrency with Modern C++ is for professional C++ programmers and takes templates, lambdas and RAII as read.[36] Mastering STM32 - Second Edition is for novices to the STM32 platform but not to C or embedded programming; its author assumes a decent knowledge of C and the fundamentals of digital electronics.[41] Knowing the RP2040 calls itself an intermediate book for readers with a little microcontroller experience and the basics of C,[44] and C++ for Embedded Systems is for developers who already know C++.[47] Build a SQL Database Engine in C++ wants a reader comfortable reading and writing C++ but needs no database internals,[38] and Build an LLM Inference Engine in C++ is for C++20 developers at home with algorithms and memory layout.[39]
History
C came out of Bell Labs in the early 1970s, designed by Dennis Ritchie alongside Unix, was standardised by ANSI in 1989, and has changed little since; C++ was Bjarne Stroustrup's work at the same laboratory from 1979, first as C with Classes, and became C++98. One source looks back at that first standard from the library's side: an algorithm such as sort or for_each could take only a function pointer or a functor, and the limitations of writing those classes were the motivation for lambdas in C++11.[21] Another puts the standards on a timeline: C++03 was a bug-fix release, C++11 ran past 1,300 pages, C++14 was a small addition, C++17 and C++23 are neither big nor small, and C++20 was big.[11]
C++11 is the hinge. It gave the language a multithreading library and a memory model, with atomic variables, threads, locks and condition variables as the building blocks and tasks as a higher abstraction; the memory model was inspired by Java's, but unlike Java's it lets a program weaken sequential consistency.[36] After it the ISO committee changed its process, and a new standard has arrived every three years: C++14 in 2014, C++17 at the end of 2017, and a feature-complete C++20 draft by the middle of 2019.[12] C++14 added reader-writer locks, and C++17 gave 69 standard algorithms parallel overloads with execution policies, a change one source says turned the C++11 and C++14 facilities into an assembly language for concurrency.[36] A design-patterns author writing in 2018 described the mood of the period: after a long stagnation C++ was evolving again, still carrying backwards compatibility with C, though not at the pace he would have liked.[32]
C++20 brought what one source calls the big four, concepts, ranges, coroutines and modules, and with them a three-way comparison operator, designated initialisers borrowed from C99, consteval and constinit, template parameters on lambdas, std::span and std::format.[16] C++23 added the first concrete coroutine to the standard, std::generator,[36] along with std::expected, std::print and the modularised standard library,[11][15] and the newest interview book already covers C++26 contracts, reflection and pack indexing.[58] The concurrency book expects its own next update to be about C++26,[36] where executors, extended futures that compose, transactional memory, task blocks and a data-parallel vector library are the proposals it describes.[36]
The embedded side has a history of its own in these pages. The STM32 author recalls the summer of 2015, when setting up a toolchain for those microcontrollers was not trivial without a paid Keil licence and ST was migrating from its Standard Peripheral Library to the CubeHAL; seven years later ST had bought Atollic and launched STM32CubeIDE, which he calls a quantum leap for the platform.[41] The Raspberry Pi Foundation announced the Pico and its RP2040 on 21 January 2021, and within two years more than a dozen boards carried the chip.[44] Before either, in 2016, one author was collating notes on the then-new ESP8266 from the Espressif SDK PDFs and the community forums,[46] and by 2018 his ESP32 notes ran to more than 1,200 pages.[45]
C
The C books divide into those that teach the language and those that teach it by building something. In both kinds the subject underneath is memory: what a pointer is, who owns what, and what happens when a program reads past the end of an array.
Fundamentals and memory
Programming with C and C++ is the broadest tour. Its C part runs from data types and format specifiers through scope and lifetime, control flow, arrays, macros, functions, strings and pointers to dynamic memory, function pointers, structures, bit fields and unions, with an appendix on GCC options, Valgrind, command-line arguments and file I/O.[3] Its section on loops is typical of its manner: an infinite while(1) loop comes with the warning that it burns CPU unless the operating system supplies a way to wait for events, and goto is shown with a legitimate use, unwinding a failed initialisation, beside the note that automotive and aerospace software treats it as bad practice; out-of-bounds access to an array is introduced as a major security problem.[3]
101 C, C++ and Linux Systems Programming Problems takes the question-and-answer route: what does a printf with more format specifiers than arguments print, and why does passing a null pointer to a %s specifier crash the program; the answers, with a variadic logging function built on va_list and vfprintf and a worked allocation of structures with calloc, are a page each.[2] The author describes it as a free, still-developing set of notes, and the C++ and Linux sections are a few pages apiece.[2] C From Scratch is the opposite in temperament: eleven chapters on fixed-width integers, booleans, arrays, strings, structures, pointers, functions as contracts and state machines, with appendices on contracts and undefined behaviour, and a method from aerospace and medical-device certification that defines correctness and data invariants before any code is written.[4] Welcome to C teaches C by contrast with Java for students switching languages for a systems course.[5]
C by project
Three books teach C by building one program. Build Your Own Lisp is the oldest, from 2015, and its project is an interpreter for a small Lisp, about a thousand lines, written step by step for readers who want to learn C or are curious how a language is built.[6] Build Your Own Redis with C/C++ writes a Redis-like key-value server from scratch in fifteen short chapters: sockets, a TCP server and client and a request-response protocol first, then an event loop, hashtables, serialisation, a balanced tree for sorted sets, timers with TTL expiry and a thread pool, each introduced where the server needs it.[8] Programming Linux Anti-Reversing Techniques starts from a plain C bind shell, built with CMake, and modifies it chapter by chapter to show how a reverse engineer would analyse the binary and how to frustrate the analysis, from compiler flags and stripped symbols through the ELF layout, LD_PRELOAD and static linking against musl to ptrace-based anti-debugging; it dates from 2016 and C is its vehicle rather than its lesson.[9] For C programmers using a library rather than writing one, NNG Reference Manual collects the manual pages of NNG, a broker-less messaging library, into a function-by-function reference whose free sample, the about text says, is the whole book.[10]
Modern C++, standard by standard
The largest group of books in the category is about what each C++ standard changed. They are written for people who already know the language, and the best of them say for every feature which compiler versions support it.
C++11 and C++14, the foundation
The sources treat C++11 as the base the later standards build on, and three of them take one C++11 feature each as a whole book. C++ Move Semantics - The Complete Guide is about move semantics, from rvalue references and std::move through the moved-from state, noexcept, value categories and perfect forwarding to move support in the standard library, with chapters on auto&& and decltype(auto) that a general C++ book would not spare the space for.[19] Notebook C++: About Move Semantics covers the same ground as 24 numbered notes, each labelled with the first standard where it applies, and its stance is cautionary: most of the time a program should stay away from std::move, and return values and temporaries should not be moved.[20] C++ Lambda Story tells the story of lambda expressions from the functor era through C++11, C++14's generic lambdas, C++17's constexpr lambdas and handling of the this pointer, and C++20, revisiting each technique as later standards extend it;[21] the author suggests that beginners skip the history and start at the C++11 chapter.[21]
C++ Initialization Story takes initialisation as its lens, on the grounds that there are more than a dozen ways to initialise a simple integer and complex rules for auto, data members and object lifetime behind them.[22] Its first chapters lay out the forms, aggregate, constant, default, direct, copy and list initialisation, and the book goes on to constructors and the copy and move operations, C++11's non-static data member initialisation, C++17's inline variables and C++20's designated initialisers, with two quizzes, an appendix on the rules for compiler-generated special member functions, and a Compiler Explorer link on every example.[22]
C++17
C++17 in Detail opens with structured bindings as the kind of feature that makes code more compact: where C++11 needed std::tie and two declared variables to take the pair returned by a set's insert, C++17 writes one line with named bindings, and the book goes through the modifiers, the three cases a binding can decompose, an array, a tuple-like type and a plain struct, and the limitations, among them that a binding could not be constexpr or captured by a lambda until a C++20 fix.[12] Its three parts cover the language changes, the new library types, std::optional, std::variant, std::any and std::string_view, the filesystem and the parallel STL, and longer examples that combine them, such as replacing enable_if with if constexpr and parallelising a CSV reader, with each feature's implementation status in GCC, Clang and MSVC as of 2019.[12] C++17 - The Complete Guide covers every C++17 feature, including the expert utilities, polymorphic memory resources, std::launder and over-aligned new, with afternotes on each feature's history.[13] The concurrency book places C++17's contribution precisely: most standard algorithms became available with an execution policy, sequential, parallel or parallel and vectorised.[36]
C++20
C++20's overview chapter is the quickest map of the standard. Concepts let a template state its requirements as part of its interface, so that a greatest-common-divisor function can be declared with an Integral concept in place of auto and the compiler checks the arguments at the call rather than deep inside the instantiation; a module is declared with an export line and imported by name, promising faster compiles and an end to header files; the ranges library lets algorithms work on containers directly, lazily and composed with a pipe; and coroutines arrive as a framework of more than twenty customisation points rather than ready-made types, which the book illustrates with a generator built on co_yield.[16] The smaller changes get a paragraph each, among them a defaulted three-way comparison operator that generates all six comparisons, consteval and constinit, std::span as a non-owning view that remembers its size, safe comparison of signed and unsigned integers, std::format with Python's syntax, and calendars and time zones in chrono.[16] C++20 - The Complete Guide gives each of the large features several chapters, with full catalogues of the standard concepts and view types and a chapter on coroutine internals.[14]
Programming with C++20 teaches by longer worked examples: a byte-stream parser with coroutines, a range adaptor with pipe syntax, a format function checked at compile time.[17] Its sample chapter on the three-way comparison starts from a medical-record-number class, shows how much code equality and ordering needed before C++20, with the friend trick and overloads in both directions, and how operator rewriting and a defaulted spaceship operator remove it, with a pitfall when the operator is defaulted over members written before C++20.[17] C++ Concepts is devoted to one feature and explains why it exists: overloads for every numeric type are tedious, an unconstrained template hides its requirements in its body and fails with long error messages at instantiation, deleting specialisations one at a time does not scale, and a static assertion over type traits is verbose; a concept states the requirement in the function header, at no runtime cost.[18] Its car-and-tank example separates syntactic requirements, which the compiler checks, from semantic ones, which it cannot: a Tank class with every method of the car concept satisfies it without being a car.[18] On the concurrency side C++20 added std::jthread, which joins in its destructor and can be interrupted cooperatively through stop tokens, along with semaphores, latches and barriers.[36]
C++23 and beyond
The C++ Standard Library is written against C++23 and notes that where a compiler supports the modularised standard library, the headers in its examples can be replaced with a single import of std.[11] C++23 - The Complete Guide covers the standard feature by feature, modules, std::print and formatted output, deducing this, std::expected and its monadic operations, std::stacktrace, std::generator, std::mdspan, span streams and the flat containers, and is published incrementally with free updates as chapters are added.[15] C++23 Best Practices revises its author's earlier guidelines for C++23, with the candid note, as of 2024, that no compiler could yet compile all of its examples as written.[34] The C++ Interview Book, a 2026 second edition of an interview book, tags questions by seniority and already asks about C++23's deducing this and std::expected and C++26's contracts, reflection and pack indexing.[58]
Writing C++ well
Beyond the standards, a cluster of books takes one keyword, one idiom or one class of bug and treats it to the end. They are short, and together they cover the ground where C++ programs go wrong.
Const, lifetime and copies
How to use const in C++ spends its first chapter on the objections a developer will hear when making more things const: that it is visual noise, that it confuses people, that it does not matter. The author answers each: unlike a comment that repeats the code or a type that auto could deduce, const adds information that cannot be expressed more simply; the confusion comes from its absence in an inconsistent codebase; and as for performance, he retells a CppCon 2016 talk in which adding const to a static array of sixteen colours cut the compiler's output from about 350 instructions to about 5.[23] The remaining chapters take const in each context, local and member variables, functions and their overloads, return types, parameters, smart pointers and rvalue references, and leave constexpr, consteval and constinit aside.[23]
Six puzzle books drill lifetime and copying without explanation. In the three Object Lifetime Puzzlers, Object Lifetime Puzzlers Book 1, Object Lifetime Puzzlers Book 2 and Object Lifetime Puzzlers Book 3, every object prints one name when its lifetime begins and another when it ends, and the reader works out the order of construction and destruction of static, local and scoped objects to spell a C++ term, 128 puzzles a volume with difficulty rising at a leisurely pace.[24][25][26] The three Copy and Reference Puzzlers, Copy and Reference Puzzlers Book 1, Copy and Reference Puzzlers Book 2 and Copy and Reference Puzzlers Book 3, pose short functions full of copies, references and reassignments and ask what the final print shows; the second volume adds std::swap and the third std::exchange.[27][28][29]
C++ AUTOPSY presents ten bugs that compiled, ran and lied, as forensic cases. Its free case is a function that builds a label in a local std::string and returns a std::string_view into it: the program compiles without a diagnostic under -Wall and -Wextra and even under the static analyser, prints blanks or garbage or crashes, and only AddressSanitizer names the fault, a read of exactly fifteen bytes from a stack frame that no longer exists.[30] The lesson generalises to std::span, iterators, references and raw pointers: a non-owning handle must never outlive its owner, a function that builds its result should return the owning type, and a view must never be bound to a temporary; the about text says the book was produced with AI assistance and human review.[30]
Templates, lambdas and idioms
Notebook C++: Tips and Tricks with Templates is a pocket reference of 24 notes on writing templates, from the first note's insistence on the term function template rather than template function through type and non-type parameters, variadic templates, decltype and declval, void_t, fold expressions and where to put enable_if, each note labelled with the earliest standard it needs and many looking behind the scenes with the author's C++ Insights tool.[31] C++ Lambda Story supplies the techniques that lambdas made idiomatic, immediately invoked function expressions, the overloaded pattern, generic and recursive lambdas, storing lambdas in containers and passing them to threads and std::async, with an appendix listing them.[21] Design Patterns in Modern C++ opens with three C++ idioms a pattern book needs: the curiously recurring template pattern, in which a class passes itself as a template argument to its base so that the base can cast this to the derived type; mixin inheritance, in which a class inherits from its own template argument so that nested instantiations compose; and static polymorphism built on the first.[32]
The standard library
The C++ Standard Library is the one compact reference: about 350 pages and more than 150 runnable examples across utilities, containers, iterators, algorithms, ranges, strings, streams, formatting, the filesystem, multithreading and coroutines, deliberately shallow per topic and linking to cppreference at the start of each one for the details it leaves out.[11] It draws a distinction it keeps throughout, calling instances of the fundamental types inherited from C values and instances of user-defined types and containers objects.[11] The library's growth is visible across the other sources: C++17's optional, variant, any and string_view are what one book calls a new vocabulary for C++ code,[12] C++20 made vector and string usable at compile time and gave the associative containers a contains member,[16] and the C++ part of Programming with C and C++ walks a beginner through the containers, the smart pointers, and threads, mutexes and condition variables.[3]
Practices and design patterns
C++ Best Practices is about fifty rules, each a few paragraphs with exercises to apply to the reader's own code, drawn from the author's twenty years as a developer and trainer and marked where a rule needs C++20.[33] Its successor, C++23 Best Practices, reorganises the rules into sixty-seven sections in five parts: philosophy, tooling (tests, warnings, sanitisers, fuzzing, package managers), API and code design, and implementation guidelines.[34] No More Helloworlds. Build a Real C++ App argues the same practices through one application rather than a list, and is described below with the build tools.
Design Patterns in Modern C++ reworks the Gang of Four patterns in C++11 through C++17. Its introduction recalls that the original patterns book had its examples in C++ and Smalltalk, that languages such as C# have since built patterns like Observer into their syntax, and that C++ has not, though std::function made much simpler; it then recaps the SOLID principles with a journal class whose persistence is moved into a separate class to give each one reason to change.[32] The examples deliberately omit const and virtual destructors to fit the page, which the author flags.[32] Implementing QuantLib is a design report on a real C++ library, and patterns appear in it where the code grew into them. A financial instrument is an abstract base with three methods, its value, an error estimate and whether it has expired; pricing is a Strategy; instruments observe their market data through the Observer pattern and a Handle, a shared pointer to a pointer that lets every copy follow a switch of data source; and a LazyObject base caches results with the Template Method pattern, with a flag set before the calculation so that a recursive call cannot loop and reset in a catch block so that an exception does not leave stale results marked valid.[35] An aside on why the cached value is mutable ends with the note that C++11 requires const methods to be thread-safe, which the design does not yet address; the book assumes both C++ and quantitative finance and teaches neither.[35]
Concurrency, performance and systems projects
C++ is the language of systems where the cost of a copy, a lock or a cache miss matters, and the sources on concurrency and on building systems from scratch are among the longest in the category.
Concurrency and the memory model
Concurrency with Modern C++ is the reference, at some 124,000 words. Its first chapter lays out the ground: reading and writing a shared variable concurrently is a data race and therefore undefined behaviour; C++ has five kinds of mutex and a lock encapsulates one so that RAII releases it; read-only shared data needs only thread-safe initialisation; and condition variables are hard enough to use correctly that tasks, promises and futures are often the easier answer.[36] The case studies sum a vector several ways with drastically different timings, solve the dining philosophers, and weaken the memory ordering of a small program step by step while verifying each step with the CppMem tool; later chapters catalogue concurrent architectures, Active Object, Monitor Object, Half-Sync/Half-Async, Reactor and Proactor, and lock-based and lock-free data structures.[36]
Ace the Trading Systems Developer Interview (C++ Edition) shows where that knowledge is examined. Its twenty sample questions, from a book of more than 120 for trading-systems roles at hedge funds, banks and exchanges, ask what the CRTP is, which of two && parameters is a forwarding reference, how to implement a read-write lock that favours waiting writers and a bounded single-producer single-consumer lock-free queue, what the memory orders relaxed, acquire, release and sequentially consistent mean, and why a thread reading one char of a two-char struct slows down when another thread writes the other: false sharing.[37] The domain questions, a fast limit order book, a streaming median in a megabyte of memory, FIX versus binary protocols, sit beside chapters on the industry, its roles and its pay.[37]
Building systems from scratch
Build a SQL Database Engine in C++ builds a single-threaded SQL engine in C++20 over fourteen units: slotted pages and a pager, a B+Tree and a buffer pool; a record layer, a catalog, a parser and an executor that reaches end-to-end SELECT and INSERT; joins, aggregation, indexes, a planner and vectorised execution; and a write-ahead log with crash recovery and a capstone checked against PostgreSQL and benchmarked against SQLite.[38] Its method is stated as a contract: nothing is asserted, everything is demonstrated, every performance claim is a table printed by a benchmark whose source is on the page, and every unit reproduces one real bug and locks it shut with a regression test.[38] The conventions are a storage engine's: expected outcomes travel in std::optional and bool and never throw, broken invariants halt the process, and every on-disk byte is explicit, little-endian and written with memcpy rather than a struct overlay, with the build refusing a big-endian host rather than claiming untested portability.[38] Concurrency and MVCC, a wire protocol and the full SQL grammar are out of scope, and the about text says the book was produced with AI assistance and human review.[38]
Build an LLM Inference Engine in C++, by the same author, applies the method to a CPU-first inference engine in C++20 that by its fourteenth unit loads a Llama-family model in GGUF format and generates text, passing through arena allocation, SIMD kernels and GEMM, a BPE tokeniser, the KV cache and flash attention, quantisation and speculative decoding, with an optional CUDA capstone.[39] Beneath CUDA C++, Mastering PTX and SASS explains how it compiles first to PTX and then to architecture-specific SASS, and how reading both diagnoses register pressure, occupancy and divergence; it is NVIDIA-specific and for programmers who already know CUDA.[40] Build Your Own Redis with C/C++, described with the C books above, belongs to the same family.
Embedded systems
By copies sold, the embedded books lead the category. They are about chips as much as about C, and they assume the language in order to teach the hardware.
STM32 and the Cortex-M
Mastering STM32 - Second Edition is a roughly 900-page guide to programming STM32 microcontrollers with STM32CubeIDE, CubeMX and the CubeHAL, using nine Nucleo boards, in three parts: setting up the toolchain, the basics of STM32 programming and the HAL, and advanced matters such as a real-time operating system, the boot sequence and USB.[41] Its twenty-eight chapters go peripheral by peripheral, GPIO, interrupts, UART, DMA, the clock tree, timers, ADC, I²C and SPI, and then to the parts a C programmer rarely sees: a linker script designed from scratch, a custom bootloader that upgrades firmware over USART with AES encryption, FreeRTOS through the CMSIS-RTOS v2 layer, the USB device stack and the design of a custom PCB.[41] The author is explicit that the book is a guide to the official HAL, not a replacement for datasheets that run to thousands of pages; asked whether to learn Arduino or STM32, he answers that Arduino is fine for professional work but hides too much of what is under the hood, and that the low-cost STM32F0 line is known as the 32-bit MCU for 32 cents.[41] Two shorter books sit on the same chips. Runtime Patterns for Embedded Systems presents eight run-time patterns for firmware, from a single task through nested state machines, event lists, message pumps, cooperative fibres and event queues, each with source from an MIT-licensed demo that runs on an STM32F746G Discovery board with a touchscreen.[42] FreeRTOS on the STM32F7 microcontroller is a 176-page book on FreeRTOS on the STM32F7 whose public listing gives only two chapter titles, the startup sequence and interrupts.[43]
RP2040, ESP32 and the hobbyist boards
Knowing the RP2040 explains the chip at the heart of the Raspberry Pi Pico rather than restating its datasheet, which the author says tells what things are but not why they matter or how to use them.[44] Its architecture chapter walks the block diagram: two Cortex-M0+ cores at 133 MHz with a single-cycle I/O block for synchronising them; 264 KB of RAM in six blocks so that both cores run without contention; a 16 KB boot ROM that presents the board as a USB mass-storage device for programming; external flash executed in place through a cache; and two programmable I/O blocks of four state machines each, which implement protocols that other microcontrollers have to bit-bang.[44] The examples are in C on Pico SDK 1.5.0, and the author concedes that the SDK's manual installation and its use of CMake are a hurdle for readers used to an IDE.[44]
The two Kolban books are collated notes rather than tutorials. Kolban's book on ESP32 gathers what the author learned programming the ESP32 from the Espressif SDK documentation and the community forums, re-released as material was added, for readers who want more background and examples than the official PDFs give;[45] Kolban's Book on the ESP32 & ESP8266 is the earlier volume and, despite its title, is about the ESP8266, referring ESP32 readers to the other book.[46] Both date from 2016 to 2018 and have no table of contents in their listings.[45][46]
Firmware in C++ and host-first design
Two 2026 books bring modern C++ to firmware. C++ for Embedded Systems is a 548-page guide to writing microcontroller firmware in C++: fixed-width types, const and volatile, the limits of the STL on a small device, the peripherals and interrupts, integration with FreeRTOS and Zephyr, low-power design, bootloaders and over-the-air updates, with a code sample and exercises in every subsection.[47] Designing Deterministic Systems with Modern C++ builds an embedded-style system, a weather reporter device, in C++17 on an ordinary Linux host before any hardware exists, treating the host, with CPU isolation, memory locking and scheduling policies, as the primary environment for development and validation, and covering bounded execution, explicit ownership, type erasure, NMEA serialisation and deterministic sensor pipelines.[48]
Protocols and hardware debugging
Two books stand beside the C in embedded work without containing any. Wired Protocols in Embedded Systems starts from the electrical principles a protocol rests on, TTL and CMOS logic levels, pull-up and pull-down resistors, output stages and the wired-AND connection, and takes 1-Wire first because, simple as a single data line looks, it uses the arbitration and addressing that I²C and I3C build on; UART, SPI, I²C and I3C follow in detail, with shorter coverage of RS-485, CAN, USB and Ethernet.[49] Its classification of protocols by duplex mode, synchronisation and serial or parallel transmission is illustrated with a cargo-tracker board on which a temperature sensor speaks 1-Wire, a GPS module UART and a flash chip SPI.[49] Diving into JTAG goes down to the JTAG protocol itself, the TAP state machine and its registers, debugging an STM32F407 through it, boundary scan for board testing, and then to attacks, dumping firmware from a Cortex-M0 and bypassing the nRF52's access protection; the author notes that the same material is free in his blog posts.[50]
Tools, builds and debugging
C and C++ programs are shaped by the tools around them: the build system, the compiler's warnings and sanitisers, and the debugger that reads what the compiler produced.
CMake and project structure
No More Helloworlds. Build a Real C++ App follows one complete C++ application to show how the pieces fit, and its contents are a map of the territory: an architecture chapter on UML, layered and hexagonal architecture, error handling by exceptions and by error codes, and Docker-based development environments; a CMake chapter on targets, property propagation and when to use PUBLIC and PRIVATE, interface and external libraries, build types, and the CMake language itself; a chapter on the core logic with interfaces, virtual destructors, smart pointers, dependency injection and the split between public and private API at the build-system level; and testing with GTest.[51] Its first edition is dated July 2026 and the sample is front matter and contents only.[51] CMake recurs elsewhere: it builds the bind shell in Programming Linux Anti-Reversing Techniques[9] and is the official way to build for the Pico SDK, with an appendix in Knowing the RP2040.[44]
The standards books are practical about compilers. C++17 in Detail gives the flags for C++17 on GCC, Clang and Visual Studio 2017 and points to the online compilers its examples were written on, Coliru, Wandbox and Compiler Explorer, along with C++ Insights, which shows how the compiler sees a lambda or a structured binding by expanding it.[12] Notebook C++: Tips and Tricks with Templates names the exact g++ and clang releases its code was tested with,[31] and C++ Initialization Story notes that a term selected in Compiler Explorer can be looked up on cppreference from the context menu.[22]
Sanitisers, static analysis and fuzzing
The undefined-behaviour case in C++ AUTOPSY is also a demonstration of the tools' limits: warnings and the static analyser miss a dangling pointer hidden inside a view, because proving that a pointer escapes its object's lifetime across function boundaries is undecidable, and the book's advice is to run the tests under AddressSanitizer.[30] C++23 Best Practices puts tests, warnings, sanitisers, fuzzing and package managers together in its tooling part,[34] and C From Scratch closes with a chapter on the path to production that includes static analysis.[4] Building Computer Security is a general security guide for engineers who are not specialists, written to be read twice and following an 80/20 rule of many short tips over polish; its programming and testing chapters are the C-relevant part: defensive programming, asserts combined with fuzzing, the compiler's hardening features, Clang's static and dynamic testing, Flawfinder as a zero-effort check and Cppcheck as a stronger one that needs configuration.[52] It has chapters on IoT devices and the CAN bus as well, and its author says breadth was prioritised over depth.[52]
Debuggers and the compiled binary
Several books by one author teach what the compiler produced rather than what the programmer wrote. Practical Foundations of Windows Debugging, Disassembling, Reversing, Second Edition is the foundation course, which disassembles small C and C++ programs to teach memory and registers, debug versus release builds, pointers, the stack and frame pointer, and how function parameters are passed, in a set of chapters for x86 and a parallel set for x64.[53] Accelerated Windows Memory Dump Analysis, Seventh Edition, Part 1, Process User Space is the first part of a crash-dump course, 26 exercises on x64 and ARM64 process dumps covering stack traces, modules, heap corruption, leaks, deadlocks and CPU spikes, each revealing one of the author's named analysis patterns.[54] Frida handbook approaches native code from the other side, instrumenting running programs with Frida; its scripting is JavaScript, and C enters through CModule, custom shared libraries and parsing structs.[55] On the embedded side, Mastering STM32 - Second Edition has a chapter on reading the Cortex-M fault registers back to the source of a fault, the watchpoints, expressions and SWV tools of STM32CubeIDE, and SEGGER J-Link debuggers,[41] and Programming with C and C++ introduces Valgrind in its appendix.[3]
Practice and interviews
The category has an unusual number of books that are nothing but problems. C++ Algorithmic Mastery: 1000 Challenges from Beginner to Legendary is the largest, a thousand C++ problems in eight volumes ordered by difficulty, every solution compiled and tested with g++; even its easiest problems carry a point of craft, reading two integers into long long so that values near a billion cannot overflow.[1] 101 C, C++ and Linux Systems Programming Problems is the C counterpart, small enough to read in a sitting.[2] Start Competitive Programming!: Ace the USACO Bronze Competition teaches problem-solving for the USACO Bronze competition as a dialogue between a coach and a team; its sample chapter works through a minimax problem about removing one tiki torch from a line and introduces exhaustive search, enumeration and greedy algorithms, with full C++ code for every problem, but the subject is the contest, not the language.[56]
Three books are for interviews. Daily C++ Interview is 149 questions with answers and references, meant to be taken one a day, on type deduction, inheritance and virtual functions, lambdas, const, smart pointers, move semantics, the rules of three, five and zero, undefined behaviour, the STL and the C++20 features, with a chapter on the different interview processes.[57] The C++ Interview Book is its second edition, grown to 173 questions in thirteen parts, each tagged Junior, Mid or Senior with likely follow-ups and cross-references, plus a 100-day study schedule, a code-reading capstone and a reference card.[58] Ace the Trading Systems Developer Interview (C++ Edition), described above, is the specialist's version, and the six puzzle books are the quiet way to the same end.
Sources
Every source is a Leanpub book. The note after each says which part of it was read; where no sample was available, only the public description and table of contents were used.
- 1.C++ Algorithmic Mastery: 1000 Challenges from Beginner to Legendary, Hatem M.: Solved and Tested — A Complete 8-Volume Journey from Beginner to Advanced Algorithms Free sample: the introduction to Book 1 of 8, its 120-problem contents with difficulty ratings, and problems 1 to 17 in full. 2026. Free sample: PDF
- 2.101 C, C++ and Linux Systems Programming Problems, devnaga Free sample: the contents of the C, C++ and Linux problem sets, the printf problems, a va_list logging function, the if-statement problems and a calloc exercise. 2025. Free sample: PDF
- 3.Programming with C and C++, devnaga Free sample: the full table of contents for the C and C++ parts, the chapter on loops and goto, the start of arrays, and part of the string-conversion section. 2025. Free sample: PDF
- 4.C From Scratch, William Murray: Prove it works before you write it. No sample: from the description and table of contents. 2026.
- 5.
- 6.Build Your Own Lisp, Daniel Holden: Learn C and build your own programming language in 1000 lines of code! No sample: from the description. 2015.
- 7.Less Confusing C++ Part 1, Namanyay Goel: Cracking CBSE's C++ made uncomplicated Free sample: how to use the book, the Hello World walkthrough with preprocessor directives, identifiers and console input, and the start of datatypes. 2017. Free sample: PDF · EPUB
- 8.Build Your Own Redis with C/C++, build-your-own.org: Network programming, data structures, and low-level C. No sample: from the description and table of contents. 2025.
- 9.Programming Linux Anti-Reversing Techniques, Jacob Baines No sample: from the description and table of contents. 2016.
- 10.
- 11.The C++ Standard Library, Rainer Grimm: What every professional C++ programmer should know about the C++ standard library. Free sample: the introduction on the book's purpose, the standards timeline, its conventions and source examples, and the author's note. 2023. Free sample: PDF · EPUB
- 12.C++17 in Detail, Bartłomiej Filipek: Learn the Exciting Features of The New C++ Standard! Free sample: the preface and about the book, who it is for and its three-part structure, example code and online compilers, and the start of the General Language Features chapter on structured bindings. 2019. Free sample: PDF · EPUB
- 13.C++17 - The Complete Guide, Nicolai M. Josuttis No sample: from the description and table of contents. 2022.
- 14.C++20 - The Complete Guide, Nicolai M. Josuttis No sample: from the description and table of contents. 2024.
- 15.C++23 - The Complete Guide, Nicolai M. Josuttis No sample: from the description and table of contents. 2026.
- 17.Programming with C++20, Andreas Fertig: Concepts, Coroutines, Ranges, and more Free sample: chapter 6 on three-way comparisons, from equality for a medical-record class to a defaulted spaceship operator and its pitfalls. 2026. Free sample: PDF
- 18.C++ Concepts, Sandor Dargo: Validate your templates compile-time Free sample: the introduction and the first chapter on what concepts are, syntactic versus semantic requirements, and the motivation from overloads, templates and type traits. 2026. Free sample: PDF · EPUB
- 19.C++ Move Semantics - The Complete Guide, Nicolai M. Josuttis No sample: from the description and table of contents. 2022.
- 20.Notebook C++: About Move Semantics, Andreas Fertig Free sample: the foreword on the Notebook C++ series, about the book, its style and conventions, and the table of contents; no note content. 2026. Free sample: PDF
- 21.C++ Lambda Story, Bartłomiej Filipek: Everything you need to know about Lambda Expressions in Modern C++! Free sample: about the book and how to read it, the example code and online compilers, the revision history, and the start of chapter 1 on callable objects in C++98/03. 2021. Free sample: PDF · EPUB
- 22.C++ Initialization Story, Bartłomiej Filipek: A Guide Through All Initialization Options and Related C++ Areas Free sample: about the book, its learning objectives, structure and prerequisites, the revision history, and the start of chapter 1 on the forms of initialisation. 2023. Free sample: PDF · EPUB
- 23.How to use const in C++, Sandor Dargo: On the virtues of constness Free sample: the introduction and the chapter answering the arguments against const, with the CppCon 2016 performance anecdote. 2021. Free sample: PDF · EPUB
- 24.Object Lifetime Puzzlers Book 1, Jason Turner: 128 Fun Puzzles No sample: from the description. 2022.
- 25.Object Lifetime Puzzlers Book 2, Jason Turner: 128 Fun Puzzles No sample: from the description. 2022.
- 26.Object Lifetime Puzzlers Book 3, Jason Turner: 128 Fun Puzzles No sample: from the description. 2022.
- 27.Copy and Reference Puzzlers Book 1, Jason Turner: 128 FUN Puzzles No sample: from the description. 2022.
- 28.Copy and Reference Puzzlers Book 2, Jason Turner: 128 FUN Puzzles No sample: from the description. 2022.
- 29.Copy and Reference Puzzlers Book 3, Jason Turner: 128 FUN Puzzles No sample: from the description. 2022.
- 30.C++ AUTOPSY, Hatem M.: Ten Investigations into Code that Compiled, Ran, and Lied Free sample: Case 09 in full, a dangling string_view returned from a function, with the sanitizer output, the mechanism and the rules. 2026. Free sample: PDF
- 31.Notebook C++: Tips and Tricks with Templates, Andreas Fertig Free sample: the foreword, about the author and the book, its style and conventions, the revision history, and the start of Note 1 on naming. 2026. Free sample: PDF
- 32.Design Patterns in Modern C++, Dmitri Nesteruk Free sample: the introduction, the preliminaries on code conventions and tools, the CRTP, mixin inheritance, static polymorphism and properties, and SOLID through the Open-Closed Principle. 2018. Free sample: PDF · EPUB
- 33.C++ Best Practices, Jason Turner: 45ish Simple Rules with Specific Action Items for Better C++ No sample: from the description and table of contents. 2022.
- 34.
- 35.Implementing QuantLib, Luigi Ballabio Free sample: the introduction on the book's purpose and style, the Instrument class and its requirements, the Observer pattern, Handle and LazyObject, and the aside on const and mutable. 2021. Free sample: PDF · EPUB
- 36.Concurrency with Modern C++, Rainer Grimm: What every professional C++ programmer should know about concurrency. Free sample: the overview chapter on the C++11 memory model and multithreading interface, C++17 parallel algorithms, coroutines, the case studies, the future of C++ and the patterns chapters. 2024. Free sample: PDF · EPUB
- 37.Ace the Trading Systems Developer Interview (C++ Edition), Dennis Thompson Sr, Jeff Vogels: Insider's Guide to Top Tech Jobs in Finance Free sample: the introduction, twenty sample questions without answers, and the full book's chapter list. 2020. Free sample: PDF
- 38.Build a SQL Database Engine in C++, Hatem M.: Through Challenges --- Storage, Query Processing, Joins, Indexes, Vectorized Execution, and Crash Recovery (Complete, Units 1-14) Free sample: what the book is, its fourteen-unit path, scope, reference machine, challenge structure and conventions, and the opening of Unit 1 on slotted pages and the pager. 2026. Free sample: PDF
- 39.Build an LLM Inference Engine in C++, Hatem M.: A Challenge-Driven Guide to Building a CPU-First Inference Engine in C++20 No sample: from the description and table of contents. 2026.
- 40.Mastering PTX and SASS, gareth thomas: Volume I — The PTX Language and Architecture Foundations No sample: from the description and table of contents. 2026.
- 41.Mastering STM32 - Second Edition, Carmine Noviello: A step-by-step guide to the most complete ARM Cortex-M platform, using the official STM32Cube development environment Free sample: the preface on the book's history and the second edition, who it is for, the Arduino question, and the chapter-by-chapter overview of all 28 chapters. 2025. Free sample: PDF · EPUB
- 42.Runtime Patterns for Embedded Systems, David Clifton: Modules and Examples with Complete Source Code for STM32F7 Discovery Board and ARM Cortex-M7 No sample: from the description and table of contents. 2023.
- 43.FreeRTOS on the STM32F7 microcontroller, Kristof Mulier No sample: from the title and the two-entry table of contents; the public description is a single word. 2021. Free sample: PDF
- 44.Knowing the RP2040, Daniel Quadros: A Guide for Programmers Free sample: the introduction on the book's scope, examples and reader, and the RP2040 architecture chapter on the processor subsystem, bus fabric, address map, clocks, memory, PIO and peripherals. 2023. Free sample: PDF · EPUB
- 45.
- 46.
- 47.C++ for Embedded Systems, gareth thomas: With Exercises and Code Samples for Intermediate Developers No sample: from the description and table of contents. 2026.
- 48.Designing Deterministic Systems with Modern C++, Mark E. Wilson: Host-First Development on Linux No sample: from the description and table of contents; the sample download failed. 2026. Free sample: PDF
- 49.Wired Protocols in Embedded Systems, Aliaksandr Kavalchuk: A Comprehensive Guide to Wired Embedded Protocols Free sample: the chapter introductions, who the book is for, the classification of communication protocols, and the cargo-tracker board example. 2026. Free sample: PDF · EPUB
- 50.Diving into JTAG, Aliaksandr Kavalchuk: A Comprehensive Guide to Debugging, Testing, and Securing Embedded Systems with JTAG Protocol No sample: from the description and table of contents. 2026.
- 51.No More Helloworlds. Build a Real C++ App, Nikolai Kutiavin: Master Real C++ Development: Architecture, Git, Testing & CMake in One Practical Workflow Free sample: the title page and the table of contents for chapters 1 to 5; no chapter text. 2026. Free sample: PDF
- 52.Building Computer Security, Thorsten Sick Free sample: the preface and goals, the structure of the book, the chapter-by-chapter content overview, and the start of the background chapter on principles. 2025. Free sample: PDF · EPUB
- 53.Practical Foundations of Windows Debugging, Disassembling, Reversing, Second Edition, Dmitry Vostokov: Training Course Free sample: the title page and the full table of contents for the x86 and x64 chapter sets; no chapter text. 2025. Free sample: PDF
- 54.Accelerated Windows Memory Dump Analysis, Seventh Edition, Part 1, Process User Space, Dmitry Vostokov: Training Course Transcript and WinDbg Practice Exercises with Notes Free sample: the table of contents and the first exercise, loading a process dump in WinDbg and reading its stack, threads and modules. 2026. Free sample: PDF
- 55.Frida handbook, Fernando Diaz (@entdark_): Learn about binary instrumentation with the Frida toolkit. No sample: from the description and table of contents. 2022.
- 56.Start Competitive Programming!: Ace the USACO Bronze Competition, Zachi Baharav, Daniel Zingaro Free sample: the opening of chapter 5 on searching and optimisation, with the tiki torches problem worked as a team discussion. 2024. Free sample: PDF · EPUB
- 57.Daily C++ Interview, Sandor Dargo: Prepare yourself for your next interview one question a day No sample: from the description and table of contents. 2026.
- 58.The C++ Interview Book, Sandor Dargo: 173 questions, from foundations to C++26 No sample: from the description and table of contents. 2026.
Further reading
Other books in the library on the same ground, not cited above.
- Accelerated Windows Memory Dump Analysis, Seventh Edition, Part 2, Kernel and Complete Spaces, Dmitry Vostokov: Training Course Transcript and WinDbg Practice Exercises with Notes The second part of the WinDbg course, on kernel and complete memory dumps, bugchecks and system threads. 2026. Free sample: PDF
- Memory Dump Analysis Anthology, Volume 1, Revised Edition, Dmitry Vostokov A revised anthology of crash-dump analysis articles from 2006 and 2007, with a catalogue of named analysis patterns and a WinDbg-for-GDB-users part. 2025. Free sample: PDF
- A QuantLib Guide, Luigi Ballabio: An introduction to the usage of the QuantLib library A work-in-progress tutorial on using the QuantLib finance library, collecting the author's earlier book, cookbook and articles into a sequence. 2026.
- Discrete Mathematical Algorithm, and Data Structure, Sanjib Sinha: Major Components of Mathematics, and Computer Science Explained with the help of C, C++, PHP, Java, C#, Python, and Dart Discrete mathematics, algorithms and data structures with examples in seven languages, C and C++ among them. 2026.
- Kolban's Book on the Raspberry Pi, Neil Kolban The author's collated notes on the Raspberry Pi, meant to be consulted by topic. 2016.
- Kolban's Book on C.H.I.P., Neil Kolban The same author's notes on the CHIP single-board computer. 2016.
- Instant Raspberry Pi, Ashwin Pajankar: The Beginner's Guide to Raspberry Pi setup A beginner's guide to setting up and administering a Raspberry Pi, with no programming. 2016. Free sample: PDF · EPUB
- A Gentle Introduction to Robotics, Charles McKnight: Volume 1 : mBlock and the mBot Robotics projects on the Arduino-based mBot kit, programmed in the block-based mBlock rather than C. 2017.