EmbeddedRelated.com
Books

C in a Nutshell: The Definitive Reference

Prinz, Peter, Crawford, Tony ● 2015

The new edition of this classic O’Reilly reference provides clear, detailed explanations of every feature in the C language and runtime library, including multithreading, type-generic macros, and library functions that are new in the 2011 C standard (C11). If you want to understand the effects of an unfamiliar function, and how the standard library requires it to behave, you’ll find it here, along with a typical example.

Ideal for experienced C and C++ programmers, this book also includes popular tools in the GNU software collection. You’ll learn how to build C programs with GNU Make, compile executable programs from C source code, and test and debug your programs with the GNU debugger.

In three sections, this authoritative book covers:

  • C language concepts and language elements, with separate chapters on types, statements, pointers, memory management, I/O, and more
  • The C standard library, including an overview of standard headers and a detailed function reference
  • Basic C programming tools in the GNU software collection, with instructions on how use them with the Eclipse IDE


Why Read This Book

You will get a compact, authoritative reference to the C language and the C11 standard that you can consult when you need a precise answer about syntax, semantics, or library behavior. The book also shows practical GNU toolchain usage (GCC, Make, GDB) so you can build, test, and debug real-world firmware and systems code.

Who Will Benefit

Experienced C/C++ developers and embedded/firmware engineers who need a precise, standards-oriented reference for writing portable, correct C code and using the GNU toolchain.

Level: Advanced — Prerequisites: Solid familiarity with C programming fundamentals (types, pointers, functions) and basic systems concepts; experience with compiling and running programs is recommended.

Get This Book

Key Takeaways

  • Understand the full set of C11 language features and how they change program semantics (including atomics, thread support, and type-generic macros).
  • Use the C standard library correctly by learning exact behaviors, edge cases, and typical usage patterns for I/O, memory, strings, and math routines.
  • Write more portable and standards-compliant C by recognizing undefined and implementation-defined behaviors and how to avoid them.
  • Build, test, and debug C programs with the GNU toolchain: GCC, GNU Make, and GDB, including common compilation and debugging workflows.
  • Apply multithreading and concurrency primitives from the C11 library safely and understand their interaction with the language memory model.

Topics Covered

  1. Introduction and C11 overview
  2. Lexical elements, tokens, and encoding
  3. Types, declarations, and storage
  4. Expressions, operators, and precedence
  5. Statements, control flow, and scopes
  6. Functions, linkage, and calling conventions
  7. The preprocessor and macros (including type-generic macros)
  8. The standard library: stdio, stdlib, string, math, time, etc.
  9. Memory management and object lifetime
  10. Concurrency: threads, atomics, and the memory model
  11. Undefined behavior, diagnostics, and implementation limits
  12. Interfacing with C++ and other languages
  13. Practical toolchain usage: GCC, GNU Make, and GDB
  14. Appendices: keywords, library reference, and compatibility notes

Languages, Platforms & Tools

CC++ (interoperability notes)POSIX systemsEmbedded Linuxx86ARM (including Cortex concepts)RISC-V (conceptual applicability)GCCGNU MakeGDB

How It Compares

More up-to-date and tool-oriented than K&R (which is a concise tutorial) and more practical than Harbison & Steele's formal reference; it pairs a standards-focused reference with GNU toolchain guidance.

Related Books

Bryant, Randal, O'Hallaron,...