Book description
Throw out your old ideas of C, and relearn a programming language that’s substantially outgrown its origins. With this revised edition of 21st Century C, you’ll discover up-to-date techniques missing from other C tutorials, whether you’re new to the language or just getting reacquainted. Get past idioms that made sense on mainframes and learn the tools you need to work with this evolved and aggressively simple language. No matter what programming language you currently favor, you’ll quickly see that 21st century C rocks.
Publisher resources
Table of contents
- Preface
- I. The Environment
- 1. Set Yourself Up for Easy Compilation
- 2. Debug, Test, Document
- 3. Packaging Your Project
- 4. Version Control
- 5. Playing Nice with Others
- II. The Language
- 6. Your Pal the Pointer
- 7. Inessential C Syntax that Textbooks Spend a Lot of Time Covering
- 8. Important C Syntax that Textbooks Often Do Not Cover
- 9. Easier Text Handling
-
10. Better Structures
- Compound Literals
- Variadic Macros
- Safely Terminated Lists
- Multiple Lists
- Foreach
- Vectorize a Function
- Designated Initializers
- Initialize Arrays and Structs with Zeros
- Typedefs Save the Day
- Return Multiple Items from a Function
- Flexible Function Inputs
- The Void Pointer and the Structures It Points To
- 11. Object-Oriented Programming in C
- 12. Parallel Threads
- 13. Libraries
- Epilogue
-
A. C 101
- The Structure
- Variable Declarations
-
Expressions
- The scoping rules for C are very simple
- The main function is special
- Most of what a C program actually does is evaluate expressions
- Functions are evaluated using copies of the inputs
- Expressions are delimited by semicolons
- There are many shortcuts for incrementing or scaling a variable
- C has an expansive definition of truth
- Dividing two integers always produces an integer
- C has a trinary conditional operator
- Branching and looping expressions are not very different from any other language
- The for loop is just a compact version of the while loop
-
Pointers
- You can directly request a block of memory
- Arrays are just blocks of memory; any block of memory can be used like an array
- A pointer to a scalar is really just a one-item array
- There is a special notation for elements of pointed-to structs
- Pointers let you modify function inputs
- Everything is somewhere, so everything can be pointed to
- Glossary
- References
- Index
Product information
- Title: 21st Century C, 2nd Edition
- Author(s):
- Release date: October 2014
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781491903896
You might also like
book
Modern C
Modern C focuses on the new and unique features of modern C programming. The book is …
book
Extreme C
Push the limits of what C - and you - can do, with this high-intensity guide …
book
Effective C
The world runs on code written in the C programming language, yet most schools begin the …
book
C Programming Language, 2nd Edition
This book is meant to help the reader learn how to program in C. It is …