Preface | p. xv |
Getting Started With C | p. 1 |
The first example | p. 3 |
Running the program | p. 4 |
A word on program layout | p. 6 |
Comments | p. 8 |
Data types | p. 9 |
Identifiers | p. 11 |
Expressions | p. 13 |
Arithmetic operators | p. 13 |
Assignment operators | p. 14 |
Relational operators | p. 15 |
Logical operators | p. 16 |
Increment and decrement operators | p. 17 |
Mixing operands in an expression | p. 17 |
Statements | p. 18 |
Standard input and output | p. 19 |
The while statement | p. 23 |
The if ... else statement | p. 26 |
Exercises 1 | p. 30 |
More Control Structures and Arrays | p. 32 |
The for statement | p. 32 |
The do ... while statement | p. 36 |
The switch statement | p. 40 |
The continue statement | p. 42 |
Arrays | p. 43 |
Strings | p. 48 |
Sequential and binary search | p. 50 |
Exercises 2 | p. 52 |
Functions - the Basics | p. 55 |
An example - factorial | p. 55 |
Function definition | p. 60 |
Sequential search | p. 61 |
Binary search | p. 63 |
The One-Zero game | p. 64 |
Exercises 3 | p. 72 |
Character Handling | p. 76 |
Character sets | p. 77 |
getchar and putchar | p. 79 |
Example - letter frequency count | p. 83 |
Strings (arrays of characters) | p. 86 |
Example - word frequency count | p. 93 |
Hashing | p. 94 |
Back to the problem | p. 98 |
Insertion sort | p. 106 |
Sorting the words | p. 110 |
Printing the table | p. 111 |
Exercises 4 | p. 118 |
Functions and Pointers | p. 120 |
Parameter passing | p. 120 |
Pointer variables | p. 125 |
More on parameter passing | p. 129 |
A voting problem | p. 131 |
Character pointers | p. 139 |
Pointer arithmetic | p. 141 |
Pointers to functions | p. 145 |
Near, far and huge pointers | p. 149 |
Recursion | p. 150 |
An example - Towers of Hanoi | p. 151 |
An example - decimal to binary | p. 153 |
An example - quicksort | p. 153 |
Exercises 5 | p. 157 |
Data Types, Operators and Storage Classes | p. 160 |
Data types | p. 160 |
Operators | p. 164 |
Bit operators | p. 167 |
Conditional expressions | p. 170 |
Storage classes in C | p. 171 |
automatic | p. 172 |
external | p. 173 |
static | p. 177 |
register | p. 179 |
Other scope rules | p. 179 |
Initialization | p. 180 |
Simple variables | p. 180 |
Array variables | p. 181 |
Two-dimensional arrays | p. 184 |
Exercises 6 | p. 185 |
Basic Structures and Linked Lists | p. 187 |
The voting problem revisited | p. 187 |
typedef | p. 189 |
Passing structures to functions | p. 192 |
Pointers to structures | p. 201 |
Linked lists | p. 202 |
Dynamic storage allocation - malloc, calloc, sizeof | p. 204 |
Building a linked list - version 1 | p. 208 |
Some characteristics of linked lists | p. 210 |
Building a linked list - version 2 | p. 211 |
Deletion from a linked list | p. 213 |
Building a linked list - version 3 | p. 214 |
Exercises 7 | p. 217 |
Binary Trees and Other Structures | p. 221 |
Binary trees | p. 221 |
Representing a binary tree | p. 228 |
Binary search trees | p. 228 |
A cross-reference program | p. 233 |
Initialization of an array of structures | p. 243 |
Nested structures | p. 244 |
Unions | p. 245 |
Bit-fields | p. 250 |
Exercises 8 | p. 253 |
Standard Input/Output | p. 256 |
stdin, stdout, stderr | p. 256 |
I/O routines | p. 257 |
Text and binary files | p. 258 |
Functions for standard input/output | p. 259 |
getchar and putchar | p. 259 |
gets and puts | p. 259 |
printf | p. 260 |
scanf | p. 268 |
Exercises 9 | p. 277 |
File Input/Output | p. 279 |
Internal vs external file name | p. 279 |
fopen and fclose | p. 280 |
getc and putc | p. 284 |
File processing example - telephone charges | p. 285 |
feof and ferror | p. 290 |
fgets and fputs | p. 291 |
sprintf and sscanf | p. 295 |
Input/output for binary files | p. 296 |
fread and fwrite | p. 296 |
Random access files | p. 300 |
rewind and fseek | p. 300 |
Indexed files | p. 303 |
Updating a random access file | p. 312 |
Exercises 10 | p. 318 |
Miscellaneous Topics | p. 320 |
The C preprocessor | p. 320 |
The #define directive | p. 321 |
The #undef directive | p. 333 |
The #include directive | p. 333 |
Conditional compilation - #if, #elif, #else, #endif directives | p. 333 |
Command-line arguments - argc and argv | p. 335 |
Two-dimensional arrays | p. 337 |
Matrix multiplication | p. 339 |
Magic squares | p. 340 |
Enumerated types - enum | p. 344 |
The goto statement | p. 349 |
const and volatile | p. 349 |
Exercises 11 | p. 350 |
Appendices | |
List of C keywords | p. 353 |
Differences between ANSI C and traditional C | p. 354 |
ASCII character set | p. 357 |
Index | p. 359 |
Table of Contents provided by Syndetics. All Rights Reserved. |