DeepRead
Cover of C Traps and Pitfalls

C Traps and Pitfalls

Andrew Koenig · 1989

Programming and computer science › C and C++

#1,628 most recommended

About the book

C Traps and Pitfalls is a short catalogue of mistakes that C programmers make, including experienced ones, and of the reasons those mistakes compile and run without complaint. It covers lexical, syntactic, and semantic pitfalls, along with linking and library problems, preprocessor misuse, and portability issues. It assumes the reader already knows the language from K&R. The central claim is that many C errors are not obscure. They follow predictably from specific features of the language, such as operator precedence, the handling of assignment within conditions, array and pointer equivalence, and the permissive rules for declarations and the preprocessor. The book holds that such errors are easy to avoid once they are recognized, so defensive programming depends on learning the specific traps. It makes this case mainly through concrete examples drawn from real programs, not through general rules of style.

Written by Claude from what it knows of this book.

What Hacker News says 79% recommend · 4% critical

02.5520092015202020252010 peak · 5
This bookAverage book in C and C++

In the commenters’ own words

What Open Library readers say 5.00 from 1 rating

  1. 51
  2. 40
  3. 30
  4. 20
  5. 10
  • 4 want to read
  • 0 reading
  • 2 have read

Only 1 rating: treat the average as a hint.

Open Library’s page for the book

What Wikipedia says

  • published January 11, 1989
  • 151 views a month

Read the Wikipedia article

Reddit communities — coming later

The threads it came up in

Details

First published
1989
ISBN
9780201179286
Editions known
2 at Open Library
Open Library
OL17755903W

C (Computer program language)Computer programming

Explore in the mosaic

Read next: its neighbours on the mosaic