Tải bản đầy đủ (.pdf) (7 trang)

practical c programming 3rd ed 1997 7301

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (206.71 KB, 7 trang )

This new edition of "Practical C Programming" teaches users not only the mechanics or
programming, but also how to create programs that are easy to read, maintain, and
debug. It features more extensive examples and an introduction to graphical
development environments. Programs conform to ANSI C.
0

TEAM FLY PRESENTS


Table of Contents
Preface
How This Book is Organized
Chapter by Chapter
Notes on the Third Edition
Font Conventions
Obtaining Source Code
Comments and Questions
Acknowledgments
Acknowledgments to the Third Edition
I. Basics
1. What Is C?
How Programming Works
Brief History of C
How C Works
How to Learn C
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
3. Style
Common Coding Practices
Coding Religion
Indentation and Code Format
Clarity
Simplicity
Summary
4. Basic Declarations and Expressions
Elements of a Program
Basic Program Structure
Simple Expressions
Variables and Storage
1

TEAM FLY PRESENTS


Variable Declarations
Integers
Assignment Statements
printf Function
Floating Point
Floating Point Versus Integer Divide
Characters
Answers
Programming Exercises
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
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
7. Programming Process
Setting Up

Specification
2

TEAM FLY PRESENTS


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
II. Simple Programming
8. More Control Statements
for Statement
switch Statement
switch, break, and continue
Answers
Programming Exercises
9. Variable Scope and Functions
Scope and Class
Functions
Functions with No Parameters

Structured Programming
Recursion
Answers
Programming Exercises
10. C Preprocessor
#define Statement
Conditional Compilation
include Files
Parameterized Macros
Advanced Features
Summary
Answers
Programming Exercises
11. Bit Operations
Bit Operators
The and Operator (&)
3

TEAM FLY PRESENTS


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
12. Advanced Types

Structures
Unions
typedef
enum Type
Casting
Bit Fields or Packed Structures
Arrays of Structures
Summary
Programming Exercises
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
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
15. Debugging and Optimization

Debugging
Interactive Debuggers
4

TEAM FLY PRESENTS


A C keyword that indicates that the value of a variable or constant can be
changed at any time. This attribute is used for memory mapped I/O, shared
memory applications, and other advanced programming.

while
An iterative statement that repeats a statement as long as a given condition
is true.

Windows
Also knows as MS -Windows. An operating system developed for personal
computers by Microsoft Corporation. Also a new operating system with a
similar user interface and API such as Windows NT and Windows 95.

X Window System
A graphics and windowing system available from the X Consortium that is
currently running on many computing systems.

Zero-based counting
A system of counting by which the first object is given the count zero rather
than one.

502


TEAM FLY PRESENTS


Colophon
Our look is the result of reader comments, our own experimentation, and feedback
from distribution channels. Distinctive covers complement our distinctive approach
to technical topics, breathing personality and life into potentially dry subjects.
The animal featured on the cover of Practical C Programming is a Jersey cow. The
Jersey, one of the many breeds of modern cows, originated from a now extinct stock
of wild cattle that inhabited western Asia, North Africa, and continental Europe.
Cows were first introduced into the western hemisphere by Christopher Columbus
on his second voya ge in 1493.
Jerseys, bred on the British isle of Jersey since 1789, were first introduced to
America in the 1850s. Smallest of the modern dairy cows, this fawn-colored beast
typically weighs between 1000 and 1500 pounds. As a milk producer, Jerseys are
the least prolific of any American dairy cow. However, their milk is creamier than
that of any other breed.
Edie Freedman designed the cover of this book, using a 19th-century engraving
from the Dover Pictorial Archive. The cover layout was produced with Quark XPress
3.32 using the ITC Garamond font.
The inside layout was designed by Nancy Priest and implemented in FrameMaker
5.0 by Mike Sierra. The text and heading fonts are ITC Garamond Light and
Garamond Book. The illustrations that appear in the book were created in
Macromedia Freehand 5.0 by Chris Reilley and updated by Robert Romano. This
colophon was written by Michael Kalantarian.

503

TEAM FLY PRESENTS




×