C in a Nutshell

Front Cover
"O'Reilly Media, Inc.", Dec 16, 2005 - Computers - 622 pages

Learning a language--any language--involves a process wherein you learn to rely less and less on instruction and more increasingly on the aspects of the language you've mastered. Whether you're learning French, Java, or C, at some point you'll set aside the tutorial and attempt to converse on your own. It's not necessary to know every subtle facet of French in order to speak it well, especially if there's a good dictionary available. Likewise, C programmers don't need to memorize every detail of C in order to write good programs. What they need instead is a reliable, comprehensive reference that they can keep nearby. C in a Nutshell is that reference.

This long-awaited book is a complete reference to the C programming language and C runtime library. Its purpose is to serve as a convenient, reliable companion in your day-to-day work as a C programmer. C in a Nutshell covers virtually everything you need to program in C, describing all the elements of the language and illustrating their use with numerous examples.

The book is divided into three distinct parts. The first part is a fast-paced description, reminiscent of the classic Kernighan & Ritchie text on which many C programmers cut their teeth. It focuses specifically on the C language and preprocessor directives, including extensions introduced to the ANSI standard in 1999. These topics and others are covered:

  • Numeric constants
  • Implicit and explicit type conversions
  • Expressions and operators
  • Functions
  • Fixed-length and variable-length arrays
  • Pointers
  • Dynamic memory management
  • Input and output

The second part of the book is a comprehensive reference to the C runtime library; it includes an overview of the contents of the standard headers and a description of each standard library function. Part III provides the necessary knowledge of the C programmer's basic tools: the compiler, the make utility, and the debugger. The tools described here are those in the GNU software collection.

C in a Nutshell is the perfect companion to K&R, and destined to be the most reached-for reference on your desk.

 

Contents

Language Basics
3
Types
20
Literals
32
Type Conversions
40
Expressions and Operators
55
Statements
83
Functions
96
Arrays
111
Dynamic Memory Management
167
Input and Output
182
Preprocessing Directives
209
II
225
The Standard Headers
227
Functions at a Glance
252
Standard Library Functions
271
III
489

Pointers
122
Structures Unions and BitFields
139
Declarations
153
Compiling with GCC
491
Using make to Build C Programs
512
Debugging C Programs with GDB
545

Other editions - View all

Common terms and phrases

Popular passages

Page ix - How This Book Is Organized This book is divided into three parts.

Bibliographic information