Panier
Livraison gratuite
Nous sommes Neutres au Carbone

C Traps and Pitfalls Andrew Koenig

C Traps and Pitfalls par Andrew Koenig

C Traps and Pitfalls Andrew Koenig


€20.00
État - Bon état
Disponible en seulement 1 exemplaire(s)

Résumé

Even C experts come across problems that require days of debugging. This book helps to prevent such problems by showing how C programmers get themselves into trouble. The book offers advice on: avoiding off-by-one errors, understanding and constructing function declarations, understanding the relationship between pointers and arrays.

C Traps and Pitfalls Résumé

C Traps and Pitfalls Andrew Koenig

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. 0201179288B04062001

À propos de Andrew Koenig

Andrew Koenig is a member of the Large-Scale Programming Research Department at AT&T's Shannon Laboratory, and the Project Editor of the C++ standards committee. A programmer for more than 30 years, 15 of them in C++, he has published more than 150 articles about C++, and speaks on the topic worldwide.

0201179288AB04062001

Sommaire



Introduction.


1. Lexical Pitfalls.

= is not ==

& and | are not && or ||

Greedy lexical analysis.

Integer constants.

Strings and characters.



2. Syntactic pitfalls.

Understanding function declarations.

Operators don't always have the precedence you want.

Watch those semicolons!

The switch statement.

Calling functions.

The dangling else problem.



3. Semantic pitfalls.

Pointers and arrays.

Pointers are not arrays.

Array declarations as parameters.

Eschew synecdoche.

Null pointers are not null strings.

Counting and asymmetric bounds.

Order of evaluation.

The &&, ||, and ! operators.

Integer overflow.

Returning a value from main.



4. Linkage.

What is a linker?

Declarations vs. definitions.

Name conflicts and the static modifier.

Arguments, parameters, and return values.

Checking external types.

Header files.



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?

Shift operators.

Memory location zero.

How does division truncate?

How big is a random number?

Case conversion.

Free first, then reallocate?

An example of portability problems.



8. Advice and answers.

Advice.

Answers.



Appendix: printf, varargs, and stdarg.

The printf family.

Simple format types.

Modifiers.

Flags.

Variable field width and precision.

Neologisms.

Anachronisms.

Variable argument lists with varargs.h.

Implementing varargs.h.

stdarg.h: the ANSI varargs.h. 0201179288T04062001

Informations supplémentaires

GOR002106417
9780201179286
0201179288
C Traps and Pitfalls Andrew Koenig
Occasion - Bon état
Broché
Pearson Education (US)
19890101
160
N/A
La photo du livre est présentée à titre d'illustration uniquement. La reliure, la couverture ou l'édition réelle peuvent varier.
Il s'agit d'un livre d'occasion - par conséquent, il a été lu par quelqu'un d'autre et il présente des signes d'usure et d'utilisation antérieure. Dans l'ensemble, nous nous attendons à ce qu'il soit en bon état, mais si vous n'êtes pas entièrement satisfait, veuillez prendre contact avec nous.