C Traps and Pitfalls
貴賓價: $931The C Puzzle Book
貴賓價: $1,520Expert C Programming: Deep C Secrets (Paperback)
貴賓價: $1,032Practical Vim: Edit Text at the Speed of Thought (Paperback)
貴賓價: $1,637More Exceptional C++ (Paperback)
售價: $1,863Practical Malware Analysis: The Hands-On Guide to Dissecting Malicious Software(快遞進口)
貴賓價: $1,829C Interfaces and Implementations : Techniques for Creating Reusable Software
售價: $945Android Wireless Application Development Volume I: Android Essentials, 3/e (Paperback)
貴賓價: $1,618Professional Android 4 Application Development, 3/e (Paperback)
售價: $945Android UI Fundamentals: Develop & Design (Paperback)
貴賓價: $1,196XDA Developers' Android Hacker's Toolkit: The Complete Guide to Rooting, ROMs and Theming (Paperback)
貴賓價: $1,931The C++ Standard Template Library (Paperback)
售價: $825Exceptional C++ Style : 40 New Engineering Puzzles, Programming Problems, and Solutions
貴賓價: $1,520A Book on C: Programming in C, 4/e (Paperback)
Even C experts come across problems that require days ofdebugging to fix. This book helps to prevent such problems byshowing how C programmers get themselves into trouble. Each ofthe book's many examples has trapped a professional programmer.
In addition to its examples, C Traps and Pitfalls offers adviceon:
- avoiding off-by-one errors
- understanding and constructing function declarations
- understanding the subtle relationship between pointers andarrays
Distilled from the author's experience over a decade ofprogramming in C, this book is an ideal resource for anyone,novice or expert, who has ever written a C program.
Table of Contents:
1. Lexical Pitfalls.
= is not ==
& and | are not && or ||
Greedy lexical analysis.
Strings and characters.
2. Syntactic pitfalls.
Understanding function declarations.
Operators don't always have the precedence you want.
Watch those semicolons!
The switch statement.
The dangling else problem.
3. Semantic pitfalls.
Pointers and arrays.
Pointers are not arrays.
Array declarations as parameters.
Null pointers are not null strings.
Counting and asymmetric bounds.
Order of evaluation.
The &&, ||, and ! operators.
Returning a value from main.
What is a linker?
Declarations vs. definitions.
Name conflicts and the static modifier.
Arguments, parameters, and return values.
Checking external types.
5. Library functions.
Getchar returns an integer.
Updating a sequential file.
Buffered output and memory allocation.
Using errno for error detection.
The signal function.
6. The preprocessor.
Spaces matter in macro definitions.
Macros are not functions.
Macros are not statements.
Macros are not type definitions.
7. Portability pitfalls.
Coping with change.
What's in a name?
How big is an integer?
Are characters signed or unsigned?
Memory location zero.
How does division truncate?
How big is a random number?
Free first, then reallocate?
An example of portability problems.
8. Advice and answers.
Appendix: printf, varargs, and stdarg.
The printf family.
Simple format types.
Variable field width and precision.
Variable argument lists with varargs.h.