C How to Program, 9/e Errata

C How to Program, 9/e Cover

 This post contains the C How to Program, 9/e errata list. We’ll keep this up-to-date as we become aware of additional errata items. Please Contact Us with any you find.

Note: After publication, we discovered a bug in our authoring software that deleted some items in single quotes, like ‘A’, from our code tables. The source-code files were not affected, but occasionally a single-quoted item is missing from a code table in the text.

Last updated January 15, 2023

Chapter 2 — Intro to C Programming

  • Page 76, in Section 2.5: “+, / and %” should be “*, / and %.

Chapter 4 — Program Control

  • Page 149, “Notes on Integral Types”:

    –32767 should be –32768
    –2147483647 should be –2147483648
    –127 should be –128

Chapter 5 — Pointers

  • Page 214, Fig. 5.9: The example should produce factorial values through 20, not 21. The value displayed for factorial(21) in the program output is incorrect because unsigned long long is not capable of representing that value.

Chapter 7 — Pointers

  • Page 320, line 19 of Fig. 7.6 should be:
    while (*sPtr != '\0') {
  • Page 321, line 22 of Fig. 7.7, should be
    for (; *sPtr != '\0'; ++sPtr) {

Chapter 10 — Structures, Unions, Bit Manipulation and Enumerations

  • Page 496, Fig. 10.4, line 24 should be:
    putchar(value & displayMask ? '1' : '0');
  • Page 496, Fig. 10.4, line 28 should be:
    putchar(' ');
  • Page 496, Fig. 10.4, line 32 should be:
    putchar('\n');
  • Page 497, seventh text line on the page should be:
    putchar(value & displayMask ? '1' : '0');
  • Page 499, Fig. 10.5, line 53 should be:
    putchar(value & displayMask ? '1' : '0');
  • Page 499, Fig. 10.5, line 57 should be:
    putchar(' ');
  • Page 499, Fig. 10.5, line 61 should be:
    putchar('\n');
  • Page 502, Fig. 10.6, line 32 should be:
    putchar(value & displayMask ? '1' : '0')
  • Page 502, Fig. 10.6, line 36 should be:
    putchar(' ');
  • Page 502, Fig. 10.6 line 40 should be:
    putchar('\n');

Questions? Contact us!

C++20 for Programmers Now Available to O’Reilly Online Learning Subscribers

C++20 for Programmers Final Cover Image

C++20 for Programmers is now available to O’Reilly Online Learning Subscribers at:

https://learning.oreilly.com/library/view/c-20-for-programmers/9780136905776/

The print version should be in-stock mid-April. Preorder it at Amazon.com or other online book retailers.

Written for programmers with a background in another high-level language, in C++20 for Programmers, you’ll learn Modern C++ development hands-on using C++20 and its “Big Four” features:

  • Ranges
  • Concepts
  • Modules
  • Coroutines

In the context of 200+, hands-on, real-world code examples, you’ll quickly master Modern C++ coding idioms using popular compilers—Visual C++®, GNU® g++, Apple® Xcode® and LLVM®/Clang.

After the C++ fundamentals quick start, you’ll move on to C++ standard library containers array and vector; functional-style programming with C++20 Ranges and Views; strings, files and regular expressions; object-oriented programming with classes, inheritance, runtime polymorphism and static polymorphism; operator overloading, copy/move semantics, RAII and smart pointers; exceptions and a look forward to C++23 Contracts; standard library containers, iterators and algorithms; templates, C++20 Concepts and metaprogramming; C++20 Modules and large-scale development; and concurrency, parallelism, the C++17 and C++20 parallel standard library algorithms and C++20 Coroutines.

Features include:

  • Rich coverage of C++20’s “Big Four”: Ranges, Concepts, Modules and Coroutines
  • Objects-Natural Approach: Use standard libraries and open-source libraries to build significant applications with minimal code
  • Hundreds of real-world, live-code examples
  • Modern C++: C++20, 17, 14, 11 and a look to C++23
  • Compilers: Visual C++®, GNU® g++, Apple Xcode® Clang, LLVM®/Clang
  • Docker: GNU® GCC, LLVM®/Clang
  • Fundamentals: Control statements, functions, strings, references, pointers, files, exceptions
  • Object-oriented programming: Classes, objects, inheritance, runtime and static polymorphism, operator overloading, copy/move semantics, RAII, smart pointers
  • Functional-style programming: C++20 Ranges and Views, lambda expressions
  • Generic programming: Templates, C++20 Concepts and metaprogramming
  • C++20 Modules: Large-Scale Development
  • Concurrent programming: Concurrency, multithreading, parallel algorithms, C++20 Coroutines, coroutines support libraries, C++23 executors
  • Future: A look forward to Contracts, range-based parallel algorithms, standard library coroutine support and more

For more details, see the Preface, the Table of Contents diagram and reviewer testimonials.

Questions? Contact us!

Java & Python Live Online Training: March–May Schedule

Looking for a one-dayfast-pacedcode-intensive introduction to PythonPython Data Science/AIJava or C++20 (coming in Q3)? Join Paul Deitel for one of his popular Full Throttle webinars at O’Reilly Online Learning!

These webinars are for you because:

  • You’re a developer who sees exciting languages and technologies popping up everywhere and you want a one-day, code-based introduction to them.
  • You’re a developer looking to enhance your career opportunities by learning new languages and technologies and you want a one-day, code-based introduction to them.
  • You’re a software team manager contemplating projects using other languages and technologies and you want a one-day, code-based introduction to them.

Use the links in the schedule below to register today at O’Reilly Online Learning for a one-day, Full Throttle

Not a subscriber? Sign up for a free trial!

Upcoming Schedule

C++20 Full Throttle coming in Q3, 2022.

Python Data Science Full Throttle: Introductory AI, Big Data and Cloud Case StudiesMarch 22, 2022
Java Full Throttle: A One-Day, Code-Intensive Java Standard Edition PresentationApril 05, 2022
Python Full Throttle: A One-Day, Fast-Paced, Code-Intensive PythonApril 12, 2022
Python Data Science Full Throttle: Introductory AI, Big Data and Cloud Case StudiesApril 26, 2022
Python Full Throttle: A One-Day, Fast-Paced, Code-Intensive PythonMay 10, 2022
Python Data Science Full Throttle: Introductory AI, Big Data and Cloud Case StudiesMay 17, 2022

Pin It on Pinterest