Practical C Programming, 3rd Edition
Why Does 2+2 = 5986?
Publisher: O'Reilly Media
Release Date: July 2011
Pages: 456
Read on Safari with a 10-day trial
Start your free trial now Buy on AmazonWhere’s the cart? Now you can get everything on Safari. To purchase books, visit Amazon or your favorite retailer. Questions? See our FAQ or contact customer service:
1-800-889-8969 / 707-827-7019
support@oreilly.com
- Multiplication and division come before addition and subtraction.
Table of Contents
-
Basics
-
Chapter 1 What Is C?
- How Programming Works
- Brief History of C
- How C Works
- How to Learn C
-
Chapter 2 Basics of Program Writing
- Programs from Conception to Execution
- Creating a Real Program
- Creating a Program Using a Command-Line Compiler
- Creating a Program Using an Integrated Development Environment
- Getting Help on UNIX
- Getting Help in an Integrated Development Environment
- IDE Cookbooks
- Programming Exercises
-
Chapter 3 Style
- Common Coding Practices
- Coding Religion
- Indentation and Code Format
- Clarity
- Simplicity
- Summary
-
Chapter 4 Basic Declarations and Expressions
- Elements of a Program
- Basic Program Structure
- Simple Expressions
- Variables and Storage
- Variable Declarations
- Integers
- Assignment Statements
- printf Function
- Floating Point
- Floating Point Versus Integer Divide
- Characters
- Answers
- Programming Exercises
-
Chapter 5 Arrays, Qualifiers, and Reading Numbers
- Arrays
- Strings
- Reading Strings
- Multidimensional Arrays
- Reading Numbers
- Initializing Variables
- Types of Integers
- Types of Floats
- Constant Declarations
- Hexadecimal and Octal Constants
- Operators for Performing Shortcuts
- Side Effects
- ++x or x++
- More Side-Effect Problems
- Answers
- Programming Exercises
-
Chapter 6 Decision and Control Statements
- if Statement
- else Statement
- How Not to Use strcmp
- Looping Statements
- while Statement
- break Statement
- continue Statement
- Assignment Anywhere Side Effect
- Answer
- Programming Exercises
-
Chapter 7 Programming Process
- Setting Up
- Specification
- Code Design
- Prototype
- Makefile
- Testing
- Debugging
- Maintenance
- Revisions
- Electronic Archaeology
- Marking Up the Program
- Using the Debugger
- Text Editor as a Browser
- Add Comments
- Programming Exercises
-
-
Simple Programming
-
Chapter 8 More Control Statements
- for Statement
- switch Statement
- switch, break, and continue
- Answers
- Programming Exercises
-
Chapter 9 Variable Scope and Functions
- Scope and Class
- Functions
- Functions with No Parameters
- Structured Programming
- Recursion
- Answers
- Programming Exercises
-
Chapter 10 C Preprocessor
- #define Statement
- Conditional Compilation
- include Files
- Parameterized Macros
- Advanced Features
- Summary
- Answers
- Programming Exercises
-
Chapter 11 Bit Operations
- Bit Operators
- The and Operator (&)
- Bitwise or (|)
- The Bitwise Exclusive or (^)
- The Ones Complement Operator (Not) (~)
- The Left- and Right-Shift Operators (<<, >>)
- Setting, Clearing, and Testing Bits
- Bitmapped Graphics
- Answers
- Programming Exercises
-
Chapter 12 Advanced Types
- Structures
- Unions
- typedef
- enum Type
- Casting
- Bit Fields or Packed Structures
- Arrays of Structures
- Summary
- Programming Exercises
-
Chapter 13 Simple Pointers
- Pointers as Function Arguments
- const Pointers
- Pointers and Arrays
- How Not to Use Pointers
- Using Pointers to Split a String
- Pointers and Structures
- Command-Line Arguments
- Programming Exercises
- Answers
-
Chapter 14 File Input/Output
- Conversion Routines
- Binary and ASCII Files
- The End-of-Line Puzzle
- Binary I/O
- Buffering Problems
- Unbuffered I/O
- Designing File Formats
- Answers
- Programming Exercises
-
Chapter 15 Debugging and Optimization
- Debugging
- Interactive Debuggers
- Debugging a Binary Search
- Runtime Errors
- The Confessional Method of Debugging
- Optimization
- Answers
- Programming Exercises
-
Chapter 16 Floating Point
- Floating-Point Format
- Floating Addition/Subtraction
- Multiplication
- Division
- Overflow and Underflow
- Roundoff Error
- Accuracy
- Minimizing Roundoff Error
- Determining Accuracy
- Precision and Speed
- Power Series
- Programming Exercises
-
-
Advanced Programming Concepts
-
Chapter 17 Advanced Pointers
- Pointers and Structures
- free Function
- Linked List
- Structure Pointer Operator
- Ordered Linked Lists
- Double-Linked Lists
- Trees
- Printing a Tree
- Rest of Program
- Data Structures for a Chess Program
- Answers
- Programming Exercises
-
Chapter 18 Modular Programming
- Modules
- Public and Private
- The extern Modifier
- Headers
- The Body of the Module
- A Program to Use Infinite Arrays
- The Makefile for Multiple Files
- Using the Infinite Array
- Dividing a Task into Modules
- Module Division Example: Text Editor
- Compiler
- Spreadsheet
- Module Design Guidelines
- Programming Exercises
-
Chapter 19 Ancient Compilers
- K&R-Style Functions
- Library Changes
- Missing Features
- Free/Malloc Changes
- lint
- Answers
-
Chapter 20 Portability Problems
- Modularity
- Word Size
- Byte Order Problem
- Alignment Problem
- NULL Pointer Problem
- Filename Problems
- File Types
- Summary
- Answers
-
Chapter 21 C’s Dustier Corners
- do/while
- goto
- The ?: Construct
- The , Operator
- volatile Qualifier
- Answer
-
Chapter 22 Putting It All Together
- Requirements
- Specification
- Code Design
- Coding
- Functional Description
- Expandability
- Testing
- Revisions
- A Final Warning
- Program Files
- Programming Exercises
-
Chapter 23 Programming Adages
- General
- Design
- Declarations
- switch Statement
- Preprocessor
- Style
- Compiling
- Final Note
- Answer
-
-
Other Language Features
-
Appendix ASCII Table
-
Appendix Ranges and Parameter Passing Conversions
- Ranges
- Automatic Type Conversions to Use When Passing Parameters
-
Appendix Operator Precedence Rules
- Standard Rules
- Practical Subset
-
Appendix A Program to Compute a Sine Using a Power Series
- The sine.c Program
-
-
Glossary
-
Colophon