Revision of their best-selling ANSI C book. New advanced topics chapters on object-oriented programming, C++, and data structures. Trademark features include thorough and accurate coverage of difficult topics such as pointers and excellent learning aids such as sections on common programming errors, 200 programming exercises, 700 end of section exercises, and 300 examples.
(NOTE: Each chapter ends with common programming errors and programming exercises).
0. Computer Systems and Program Development.
Algorithms. Computer Systems. Internal representations. Programming Languages. Program Development. Why C?
A First C Program. Sample application: Conversion of lengths. Identifiers. The while statement. Sample Application: Computing Income Tax. The if statement. More on the if statement. Redirecting input and output. Files.
Characters and integers. Floating-point variables. Arithmetic operations. Relational and logical operators and the assignment operator. Sample application: Statistical measures. The for statement and the comma operator. The operators ++ and —. Sample application: Printing a bar graph.
The break and continue statements. Sample application: Generating prime numbers. The switch statement. The goto statement and labels. Conditional expressions. Sample application: Printing a calendar. The cast operator. The sizeof operator. Getchar and putchar. Bitwise operators.
Introduction. Arguments and parameters. Call by value. Sample application: Computing Resistance. The scope of variables. The preprocessor. Sample application: Simulating a dice game. Recursion. Sample application: Recursive tiling. Functions with a arbitrary number of arguments.
Why arrays? Array indexes and cell offsets. Sample application: Tracking and reporting car sales. Character strings as arrays of characters. Sample application: Formatting text with a given line length. Arrays as function arguments. String-handling functions. Sample application: Computing a string's length. Multidimensional arrays. Sample application: Matrix multiplication. Sample application: Sorting and searching. Sample application: Forest fire percolation.
Pointer variables. Levels of indirection. Pointers and arrays. Pointers as arguments to functions. Sample application: Reversing a string in place. Sample application: Parallel computing. Pointers and multidimensional arrays. Command line arguments. Pointers to functions. Sample application: Comparing sorting algorithms.
Storage classes in a single-source file: auto, extern, static. Sample application: Breaking text into pages. The storage class register. Storage classes in multiple-source files. Sample application: An interactive calculator. Nested blocks. Storage classes for functions. Type qualifiers: const and volatile. Sample application: A scheduling problem.
Opening and closing files. Character input/output. Sample application: Determining a source file's size in bytes. String input/output. Formatted input/output. Unformatted input/output. Moving around in a file: fseek, ftell, rewind. Sample application: A random access file.
Introduction to structures. Sample application: Pattern recognition. The typedef construct. Operations on structures. Pointers to structures, nested structures, and self-referential structures. Structures and functions. Sample application: Sales reporting. Unions and bit fields. Enumerated types.
Compile-time and run-time storage allocation. Linked lists. Sample application: A text editor. Stacks and queues. Sample application: Converting from infix to postfix. Graphs and trees. Tree traversals. Breadth-first search and depth-first search. Sample application: Heuristic graph search.
Assertions. Exception-handling and jumps. Graphics support for C. Sample application: Fractals. C and C++.