The Table of Contents for On To C follows.
Additional information about this book, along with access to software, is
available via http://www.ai.mit.edu/people/phw/Books/
Contents
In this Table of Contents, you learn about what On To C contains
in detail.
1 How this Book Teaches you the Language
- Characteristics of C
- Why you should learn C
- Programming cliches
- The organization of this book
2 How to Compile and Run a Simple Program
- Compiling, linking, and executing
- Statements and declarations
- printf and print specifications
- Case sensitivity and blank insensitivity
- Operators and operands
3 How to Declare Variables
- Data types and variable declarations
- Initialization and assignment
- Integral data types
- Comments
4 How to Write Arithmetic Expressions
- Precedence and association
- Binary and unary operators
- Type casting
5 How to Write Statements that Read Information from your Keyboard
- scanf and read specifications
- Input redirection
6 How to Define Simple Functions
- Calling and returning from functions
- Arguments, parameters, and values
7 How to Benefit from Procedure Abstraction
- Making programs easier to reuse, read, and debug
- Making programs easier to augment, improve, and change
8 How to Work with Local and Global Variables
- Extent and scope
- Local and global variables
- Macro symbols
9 How to Perform Tests Using Numerical Predicates
- Equal, ==, and not equal, !=
- Greater than, >, and less than, <
- Not, !
10 How to Write One-Way and Two-Way Conditional Statements
- Boolean expressions
- if and if else
- Empty and compound statements
- The conditional operator, ?:
11 How to Combine Boolean Expressions
- And, &&, and or, ||
- Evaluation order
12 How to Write Iteration Statements
- while and for statements
- Augmented assignment operators
- Increment, ++, and decrement, --, operators
- Side effects
13 How to Write Iterative Filters
- while reading and for reading loops
- Action of the read function at the end of a file
14 How to Write Recursive Functions
- Functions that call themselves
- The base part and the recursion part
15 How to Solve Definition Ordering Problems with Function Prototypes
- The definition-before-call requirement
- Declare now, define later
16 How to Create Structures and Objects
- User-defined data types, structures, and objects
- Structure declaration and structure variables
- The structure-member operator
17 How to Work with Arrays Of Numbers
- Arrays of numeric elements
- Filling a numeric array from a file
- Multidimensional arrays
18 How to Work with Arrays of Structure Objects
- Arrays of structure-object elements
- Filling an object array from a file
19 How to Use Pointer Parameters to Avoid Structure Copying
- Why you should avoid structure copying
- Pointers and pointer dereferencing
- The address-of operator, &
- The structure-pointer operator, ->
20 How to Use Pointer Parameters to Alter Values
- Avoiding returned-value copying
- Returning multiple values
21 How to Access Array Elements Using Pointers
- Pointer arithmetic
- Array names and constant pointers
- Arrays and function parameters
22 How to Create New Structure Objects at Run Time
- The free store
- Allocating space with malloc
- Pointer casting
23 How to Store Pointers to Structure Objects
- Wasting space by defining too-large object arrays
- Saving space by defining too-large pointer arrays
24 How to Define Constructor, Reader, and Writer Functions
25 How to Benefit from Data Abstraction
26 How to Write Multiway Conditional Statements
- switch statements
- exit statements
27 How to Use Enumerations to Improve Readability
- The mnemonic sterility of numbers
- The enumeration data type
28 How to Use Type Synonyms to Improve Readability
29 How to Use Unions to Capture Class Distinctions
30 How to Use Bits to Record State Information
- Status registers and status bits
- Setting and resetting
- Bitwise and, &, and bitwise or, |
- Masks and the shift operators, >> and <<
31 How to Write Functions that Return Character Strings
- Character strings and character arrays
- The null character, \O
32 How to Write Statements that Read Character Strings
- Character arrays and input buffers
- Using the read function with a character pointer
33 How to Deposit Character Strings into Structure Objects
- Creating character arrays at run time using malloc
- Using strlen and strcpy to measure and copy
- The null pointer, NULL
34 How to Test String Characters
- Characters viewed as integers
- Obtaining character codes
35 How to Do Tabular Printing
- Field width
- Padding characters
36 How to Read From and Write to Files
- File pointers
- Opening and closing files
- File reading and writing
37 How to Reclaim Memory
- Garbage and memory leaks
- Suspending program operation using sleep
- free viewed as the complement of malloc
38 How to Tell Time
39 How to Access Command-Line Arguments
- Arguments of main
- File specifications and flags
40 How to Define Functions with a Variable Number of Arguments
41 How to Arrange for Conditional Compilation
- Testing for macro definitions
- Compile-time versus run-time conditionalization
42 How to Arrange Functions in a Multiple-File Program
- Moving declarations into header files
- Compiling to create object files
- Linking to create executable programs
- Managing global variables with static and extern
43 How to Arrange Global Variables in a Multiple-File Program
- The static variable declaration
- The extern variable declaration
44 How to Compile a Multiple-File Program
- Recording file dependencies in a makefile
- Maintaining systems using the make utility
Appendix A: Print Specifications
Appendix B: Read Specifications
Appendix C: Operator Precedence
Appendix D: Formatted Time Display
Appendix E: How to Use Sockets to Connect Programs
Colophon
Index