Skip to Content
21st Century C, 2nd Edition
book

21st Century C, 2nd Edition

by Ben Klemens
October 2014
Intermediate to advanced content levelIntermediate to advanced
408 pages
10h 19m
English
O'Reilly Media, Inc.
Book available
Content preview from 21st Century C, 2nd Edition

Part II. The Language

This is the part where we reconsider everything about the C language.

There are two parts to the process: working out what bits of the language not to use, and then finding out about the new things. Some of the new things are syntactic features, such as being able to initialize a list of struct elements by name; some of the new things are functions that have been written for us and are now common, such as the functions that will allow us to write to strings without quite as much pain.

I assume basic knowledge of C. Readers new to the language may want to read Appendix A first.

The chapters cover the material as follows:

Chapter 6 provides a guide for those perplexed (or perhaps made a bit uneasy) by pointers.

Chapter 7 is where we start building by tearing down. We’ll go over a survey of concepts covered by the typical textbooks that I believe should be downplayed or considered deprecated.

Chapter 8 goes in the other direction, offering more in-depth discussion of concepts I found were mentioned only in passing or were missing entirely from typical textbooks.

In Chapter 9, we pay special attention to strings and work out how to handle them without memory allocation or character-counting madness. malloc will be lonely, because you’ll never call it.

Chapter 10 presents newer syntax, which will let us write function calls in ISO-standard C with inputs such as lists of arbitrary length; e.g., sum(1, 2.2, [...] 39, 40) or named, optional elements like new_person ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical C

Practical C

Giulio Zambon
Smaller C

Smaller C

Marc Loy
C in a Nutshell, 2nd Edition

C in a Nutshell, 2nd Edition

Peter Prinz, Tony Crawford

Publisher Resources

ISBN: 9781491904428Errata Page