Modern C

Table of Contents



Jens Gustedt
(@JensGustedt@digitalcourage.social)

1. Early access to the C23 edition of Modern C

Manning's early access program (MEAP) for the new edition is now open at

https://www.manning.com/books/modern-c-third-edition

There is a special code au35gus to get 35% off of the official price from all Manning products, including Modern C.

The previous edition already has been largely successful and is considered by some as one of the reference books on C. This new edition has been the occasion to overhaul the presentation in many places, but its main purpose is the update to the new C standard, C23. The goal is to publish this new edition of Modern C at the same time as the new C standard goes through the procedure of ISO publication and as new releases of major compilers will implement all the new features that it brings.

Among the most noticeable changes and additions that we handle are those for integers: there are new bit-precise types coined _BitInt(N), new C library headers <stdckdint.h> (for arithmetic with overflow check) and <stdbit.h> (for bit manipulation), possibilities for 128 bit types on modern architectures, and substantial improvements for enumeration types. Other new concepts in C23 include a nullptr constant and its underlying type, syntactic annotation with attributes, more tools for type generic programming such as type inference with auto and typeof, default initialization with {}, even for variable length arrays, and constexpr for name constants of any type. Furthermore, new material has been added, discussing compound expressions and lambdas, so-called “internationalization”, a comprehensive approach for program failure.

During MEAP we will also add an appendix and continue work on a temporary include header for an easy transition to C23 on existing platforms, that will allow you to start off with C23 right away.

We also encourage you to post any questions or comments you have about the content in the liveBook Discussion forum. We appreciate knowing where we can make improvements and increase your understanding of the material.

What follows below is for the moment only information about the previous edition. It will be updated once the book is completely finished and I will also enable free access to the new version after some grace period.


2. Print version

Print and eBook editions of Modern C, Second Edition, can now be ordered from my publisher, Manning. Help and investment from Manning have been crucial for this Second Edition of Modern C.

If you’d like to support our hard work, and receive a nicely formatted print or eBook, please consider buying a copy from https://manning.com at the following URL:

Those purchasing a copy are helping keep this important resource available as an open edition on this website.

3. Online resources

3.1. Downloads

The most recent version available is from Oct. 10, 2019, with some minor fixes, mostly typos.

3.2. Blog

I sometimes use my blog to dump new ideas where I think C should head to, and to keep an updated list of the features that might go into C2x.

3.3. Bugs

Previously, before migrating to this gitlab site, bugs such as typos have been followed with a bug tracker. That list has been saved, but not yet processed into an updated version. Eventually, we might open up an issue tracker, here.

4. Be a sponsor

I am not producing this book for a living, but the people at Manning do. If you still think that you don't want to buy a printed or e-paper version and are satisfied by using the public version, you're welcome to do so.

You could still think of contributing a little bit, either by volunteering to

  • your favorite software project
  • a software industry improvement project
  • a free speech or publication project
  • the national C standards committee of your country

or anything else that makes the whole world (or maybe just our planet) a better place.

You could also contribute by giving whatever money you may spare to such a project. There are many projects in need of contributions, not all important open source projects out there are financed by big money, and that independence is important.

5. Terms

5.2. Copyright and License of provided source code

The C source code provided with this book is licensed under the
following standard MIT license:

----------------------------------------------------------------------
Copyright © 2015-2019 Jens Gustedt

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------

Author: Jens Gustedt

Created: 2024-02-01 Do 09:47

Validate