Almost 50 years ago, the C language defined modern computer programming. This book shows you why C is still as powerful and popular as ever, with an inside look at the new C23 standard.
For programs that need to be small, fast, and unfailingly reliable, C is still the gold standard. Whether you’re writing embedded code, low-level system routines, or high-performance applications, C is up to the challenge. This unique book by Jens Gustedt, a member of the ISO C standards committee, gets you up to speed with C23.
In Modern C, Third Edition you’ll:
Learn C basics, core features, and advanced concepts
Leverage major C23 improvements for security, reliability, and performance
Write portable code that runs anywhere
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Modern C (3rd Edition) — Reading Guide
## 【One-Line Pitch】
A standards-committee insider's guide to modern C programming, covering everything from core language fundamentals to the latest C23 improvements for writing safer, more portable, and higher-performance code. Essential reading for embedded developers, systems programmers, and anyone who needs C to be small, fast, and reliable.
## 【Book Arc】
- **Opening (~0%–10%)**: Sets up the C23 landscape, compiler setup (clang/gcc/icc with `-std=c2x`), and introduces the book's style conventions—left-binding type modifiers, array notation for pointer parameters, and why these choices improve readability and safety.
- **Early (~10%–23%)**: Builds the foundation with scopes, blocks, and function parameters, then moves into arithmetic—overflow behavior, division/remainder semantics, and a practical Union-Find challenge that exercises core concepts. Type selection guidance (size_t, unsigned, signed, ptrdiff_t, double) is established here.
- **Early-to-Middle (~23%–32%)**: Dives into C23's new features—`constexpr` for compile-time checked constants, macro best practices, and the critical distinction between well-defined behavior and undefined behavior (especially around signed arithmetic and traps).
- **Middle (~39%–48%)**: Covers aggregates and type abstraction: structures with designated initializers, the new `_BitInt(N)` types for precise bit-field control, typedef aliases, and command-line argument conventions (`argv[0]`, `argv[argc]` being null).
- **Late (~48%+)**: Transitions to the C standard library—its separation from the language proper, the API design that allows compiler/library independence (glibc vs musl on Linux), and checked arithmetic operations like `ckd_add` for overflow detection.
## 【Key Takeaways】
- **C23 is a modernization milestone** (Opening): The new standard brings `constexpr`, `_BitInt` types, and checked arithmetic—features that address security and reliability concerns without abandoning C's performance ethos. Compiler support varies, so check your toolchain's C23 readiness.
- **Style conventions prevent real bugs** (Early): Left-binding type modifiers (`char* name` not `char *name`) and array notation for non-null pointer parameters (`char const string[static 1]`) make code self-documenting and catch null-pointer misuse at the type level.
- **Unsigned types are your default for sizes and counts** (Early): They have mathematically consistent modulo arithmetic, can't raise overflow signals, and optimize best. Use `size_t` for sizes/cardinalities, `unsigned` for small non-negative quantities, and reserve signed types for values that genuinely need signs.
- **`constexpr` gives compile-time safety** (Early): C23's `constexpr` validates that initializers fit exactly—a conversion losing precision becomes a compile error, not silent runtime corruption. This is a major improvement over macro-based constants.
- **Signed arithmetic can trap badly** (Early): Negation can overflow (`INT_MIN < -INT_MAX`), and bit operations on negative values have murky semantics. Avoid signed arithmetic unless you truly need it; undefined behavior means the program has failed.
- **`_BitInt(N)` enables precise bit-fields** (Middle): C23's new exact-width integer types let you define bit-fields with guaranteed behavior—no more implementation-defined widths. Use `bool` for 1-bit flags and `_BitInt(N)` for numerical fields of width N.
- **The C library is separable from the language** (Late): The standard library's clear API allows mixing compilers and library implementations (gcc/clang with glibc/musl on Linux). Checked arithmetic functions like `ckd_add` detect overflow without the performance cost of manual checks.
## 【Reading Tips】
- **Skim the compiler setup section** if you're already comfortable with command-line compilation—just note the `-std=c2x` flag for C23 features.
- **Deep-read the type selection guidance** (Takeaways 5.2 #3–#8): This is the book's practical core for writing correct, portable code. The rules are simple but the reasoning is subtle.
- **Work through the Union-Find challenge** (Early): It's a genuine exercise that forces you to apply size_t, arrays, and algorithm design together—not just read about them.
- **Pay special attention to the undefined behavior section** (Early): Understanding traps and why signed arithmetic is dangerous will save you from the most insidious C bugs.
- **The style conventions section is worth adopting wholesale**—even if you disagree with some choices, consistency in type binding and pointer notation eliminates a whole class of declaration errors.
## 【Coverage Limits】
Excerpts cover roughly the first half of the book (through the standard library introduction). Later sections on advanced topics, program failure handling (section 15), and full library function groups are not covered in this guide.
##
Page 10
tainly for a more varied and fast-paced technological life. At a time when it is hard to tell one computer book from another, Manning celebrates the inventiv...
n converting to the type unsigned on the left. Takeaway 5.6.5 #1 The initializer of a constexpr must fit exactly. constexpr can also be used for compound lit...
m executable. Takeaway 7.2 #7 argv[argc] is a null pointer. In the argv array, the last argument could always be identified using this property, but this fea...
xplained in subsection 8.7. strftime receives three arrays: a char[max] array that is to be filled with the result string, another string that holds the form...
pe rat that is supposed to be used for rational arithmetic: This is a direct implementation of such a type, and nothing you should use as a library outside t...
e code (and if you are still here, you probably are), early errors in the development phase are really helpful.11 So, consider crashing a feature. See the bl...
ion that refers to an object outside of its lifetime fails. How the start and end points of an object are defined depends on the tools we use to create it. W...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Modern C (MEAP v4) 3ed 2024 Covers the C23 standard (Jens Gustedt) (Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Modern C (MEAP v4) 3ed 2024 Covers the C23 standard (Jens Gustedt) (Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment