Heh...
Out of perverse curiousity, I skiimmed through the whole of C for Dummies a few weeks ago. I found around 20-30 errors. A few based on typesetting messups, but a disturbing amount of fundamental errors about the C language. Examples that spring to mind:
- repeated use of fflush(stdin)
- repeated use of char instead of int for the return of getchar.
- repeated use of gets(). Though he actually points out that it's dangerous and why, but says it's "okay to use while learning".
- really strange explanation of scanf, pointing out that you need an & in front of the variables, but if it's a string, they're "optional". No explanation of why, because pointers are beyond the scope of the book.
- assumption that C is tied to the ASCII character set throughout the book.
- implication that if (foo = <constant>) will always be true, apparently doesn't realise that if <constant> is 0, it will be false.
- awareness of, but misunderstanding of common newbie errors such as if (a == b) to compare strings. Then goes on to say that comparing strings is beyond the scope of the book, and to read his "more advanced" all in one desk reference.
- misunderstanding of short-circuiting on logical operators && and ||
- claims non-standard functions are part of the standard, such as sleep()
To the book's credit, it generally tries to point out things that are not portable, and tries to produce conforming ANSI C. For example, I didn't see any void mains.
Edit:
Yeah, he actually canned my accountOriginally Posted by Prelude