did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780132404167

C: How to Program

by ;
  • ISBN13:

    9780132404167

  • ISBN10:

    0132404168

  • Edition: 5th
  • Format: Paperback w/CD
  • Copyright: 2010-01-01
  • Publisher: Prentice Hall
  • View Upgraded Edition
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $123.00

Summary

The Deitels' groundbreaking How to Program series offers unparalleled breadth and depth of programming concepts and intermediate-level topics for further study. The books in this series feature hundreds of complete, working programs with thousands of lines of code. Includes strong treatment of structured algorithm and program development in ANSI/ISO C with 150 working C programs. New chapters added for C99 and game programming with the Allegro C Library. Includes rich, 300-page treatment of object-oriented programming in C++. Presents each new concept in the context of a complete, working program, immediately followed by one or more windows showing the program's input/output dialog. Enhances the Live-Code Approach with syntax coloring. Provides Helpful Programming Tips, all marked by icons: Good Programming Practices, Common Programming Errors, Error-Prevention Tips, Performance Tips, Portability Tips, Software Engineering Observations, Look and Feel Observations. A valuable reference for programmers and anyone interested in learning the C programming language.

Table of Contents

Preface xxi
Introduction to Computers, the Internet and the Web
1(31)
Introduction
2(2)
What Is a Computer?
4(1)
Computer Organization
4(1)
Early Operating Systems
5(1)
Personal, Distributed and Client/Server Computing
6(1)
Machine Languages, Assembly Languages and High-Level Languages
6(2)
Fortran, Cobol, Pascal and Ada
8(1)
History of C
8(1)
C Standard Library
9(1)
C++
10(1)
Java
11(1)
Basic, Visual Basic, Visual C++, Visual C# and .NET
11(1)
Key Software Trend: Object Technology
12(1)
Typical C Program Development Environment
13(3)
Hardware Trends
16(1)
History of the Internet
16(2)
History of the World Wide Web
18(1)
Notes About C and This Book
18(1)
Web Resources
19(13)
Introduction to C Programming
32(30)
Introduction
33(1)
A Simple C Program: Printing a Line of Text
33(4)
Another Simple C Program: Adding Two Integers
37(5)
Memory Concepts
42(1)
Arithmetic in C
43(4)
Decision Making: Equality and Relational Operators
47(15)
Structured Program Development in C
62(45)
Introduction
63(1)
Algorithms
63(1)
Pseudocode
64(1)
Control Structures
64(2)
The if Selection Statement
66(2)
The if ...else Selection Statement
68(3)
The while Repetition Statement
71(1)
Formulating Algorithms Case Study 1: Counter-Controlled Repetition
72(3)
Formulating Algorithms with Top-Down, Stepwise Refinement Case Study 2: Sentinel-Controlled Repetition
75(6)
Formulating Algorithms with Top-Down, Stepwise Refinement Case Study 3: Nested Control Structures
81(4)
Assignment Operators
85(1)
Increment and Decrement Operators
85(22)
C Program Control
107(44)
Introduction
108(1)
Repetition Essentials
108(1)
Counter-Controlled Repetition
109(2)
for Repetition Statement
111(2)
for Statement: Notes and Observations
113(1)
Examples Using the for Statement
114(4)
switch Multiple-Selection Statement
118(6)
do...while Repetition Statement
124(2)
break and continue Statements
126(2)
Logical Operators
128(2)
Confusing Equality (==) and Assignment (=) Operators
130(2)
Structured Programming Summary
132(19)
C Functions
151(57)
Introduction
152(1)
Program Modules in C
152(1)
Math Library Functions
153(2)
Functions
155(1)
Function Definitions
156(4)
Function Prototypes
160(2)
Function Call Stack and Activation Records
162(1)
Headers
163(1)
Calling Functions: Call-by-Value and Call-by-Reference
164(1)
Random Number Generation
165(5)
Example: A Game of Chance
170(4)
Storage Classes
174(2)
Scope Rules
176(3)
Recursion
179(4)
Example Using Recursion: Fibonacci Series
183(3)
Recursion vs. Iteration
186(22)
C Arrays
208(59)
Introduction
209(1)
Arrays
209(2)
Defining Arrays
211(1)
Array Examples
211(14)
Passing Arrays to Functions
225(4)
Sorting Arrays
229(3)
Case Study: Computing Mean, Median and Mode Using Arrays
232(3)
Searching Arrays
235(7)
Multiple-Subscripted Arrays
242(25)
C Pointers
267(58)
Introduction
268(1)
Pointer Variable Definitions and Initialization
268(1)
Pointer Operators
269(3)
Passing Arguments to Functions by Reference
272(4)
Using the const Qualifier with Pointers
276(6)
Bubble Sort Using Call-by-Reference
282(3)
sizeof Operator
285(3)
Pointer Expressions and Pointer Arithmetic
288(2)
Relationship between Pointers and Arrays
290(5)
Arrays of Pointers
295(1)
Case Study: Card Shuffling and Dealing Simulation
295(5)
Pointers to Functions
300(25)
C Characters and Strings
325(47)
Introduction
326(1)
Fundamentals of Strings and Characters
326(2)
Character-Handling Library
328(5)
String-Conversion Functions
333(5)
Standard Input/Output Library Functions
338(5)
String-Manipulation Functions of the String-Handling Library
343(2)
Comparison Functions of the String-Handling Library
345(2)
Search Functions of the String-Handling Library
347(7)
Memory Functions of the String-Handling Library
354(4)
Other Functions of the String-Handling Library
358(14)
C Formatted Input/Output
372(29)
Introduction
373(1)
Streams
373(1)
Formatting Output with print
373(1)
Printing Integers
374(2)
Printing Floating-Point Numbers
376(1)
Printing Strings and Characters
377(2)
Other Conversion Specifiers
379(1)
Printing with Field Widths and Precision
380(3)
Using Flags in the printf Format Control String
383(2)
Printing Literals and Escape Sequences
385(1)
Reading Formatted Input with scanf
386(15)
C Structures, Unions, Bit Manipulations and Enumerations
401(37)
Introduction
402(1)
Structure Definitions
402(3)
Initializing Structures
405(1)
Accessing Members of Structures
405(2)
Using-Structures with Functions
407(1)
typedef
407(1)
Example: High-Performance Card Shuffling and Dealing Simulation
408(3)
Unions
411(2)
Bitwise Operators
413(9)
Bit Fields
422(4)
Enumeration Constants
426(12)
C File Processing
438(39)
Introduction
439(1)
Data Hierarchy
439(2)
Files and Streams
441(1)
Creating a Sequential-Access File
442(5)
Reading Data from a Sequential-Access File
447(5)
Random-Access Files
452(1)
Creating a Random-Access File
453(2)
Writing Data Randomly to a Random-Access File
455(3)
Reading Data from a Random-Access File
458(1)
Case Study: Transaction-Processing Program
459(18)
C Data Structures
477(56)
Introduction
478(1)
Self-Referential Structures
479(1)
Dynamic Memory Allocation
479(2)
Linked Lists
481(9)
Stacks
490(6)
Queues
496(6)
Trees
502(31)
C Preprocessor
533(12)
Introduction
534(1)
#include Preprocessor Directive
534(1)
#define Preprocessor Directive: Symbolic Constants
535(1)
#define Preprocessor Directive: Macros
535(2)
Conditional Compilation
537(1)
#error and #pragma Preprocessor Directives
538(1)
# and ## Operators
538(1)
Line Numbers
539(1)
Predefined Symbolic Constants
539(1)
Assertions
540(5)
Other C Topics
545(21)
Introduction
546(1)
Redirecting Input/Output on Linux/Unix and Windows Systems
546(1)
Variable-Length Argument Lists
547(2)
Using Command-Line Arguments
549(2)
Notes on Compiling Multiple-Source-File Programs
551(1)
Program Termination with exit and atexit
552(2)
volatile Type Qualifier
554(1)
Suffixes for Integer and Floating-Point Constants
554(1)
More on Files
554(3)
Signal Handling
557(2)
Dynamic Memory Allocation: Functions calloc and realloc
559(1)
Unconditional Branching with goto
560(6)
Game Programming with the Allegro C Library
566(58)
Introduction
567(1)
Installing Allegro
567(1)
A Simple Allegro Program
568(1)
Simple Graphics: Importing Bitmaps and Blitting
569(5)
Animation with Double Buffering
574(7)
Importing and Playing Sounds
581(4)
Keyboard Input
585(5)
Fonts and Displaying Text
590(6)
Implementing the Game of Pong
596(6)
Timers in Allegro
602(6)
The Grabber and Allegro Datafiles
608(8)
Other Allegro Capabilities
616(1)
Allegro Internet and Web Resources
617(7)
Sorting: A Deeper Look
624(20)
Introduction
625(1)
Big O Notation
625(1)
Selection Sort
626(4)
Insertion Sort
630(3)
Merge Sort
633(11)
Introduction to C99
644(22)
Introduction
645(1)
Support for C99
645(1)
New C99 Headers
646(1)
// Comments
647(1)
Mixing Declarations and Executable Code
647(2)
Declaring a Variable in a for Statement Header
649(1)
Designated Initializers and Compound Literals
650(3)
Type bool
653(2)
Implicit int in Function Declarations
655(1)
Complex Numbers
656(1)
Variable-Length Arrays
657(2)
Other C99 Features
659(2)
Internet and Web Resources
661(5)
C++ as a Better C; Introducing Object Technology
666(35)
Introduction
667(1)
C++
667(1)
A Simple Program: Adding Two Integers
668(2)
C++ Standard Library
670(1)
Header Files
671(2)
Inline Functions
673(3)
References and Reference Parameters
676(4)
Empty Parameter Lists
680(1)
Default Arguments
681(2)
Unary Scope Resolution Operator
683(1)
Function Overloading
684(3)
Function Templates
687(3)
Introduction to Object Technology and the UML
690(4)
Wrap-Up
694(7)
Introduction to Classes and Objects
701(43)
Introduction
702(1)
Classes, Objects, Member Functions and Data Members
702(1)
Overview of the Chapter Examples
703(1)
Defining a Class with a Member Function
704(4)
Defining a Member Function with a Parameter
708(3)
Data Members, set Functions and get Functions
711(7)
Initializing Objects with Constructors
718(4)
Placing a Class in a Separate File for Reusability
722(4)
Separating Interface from Implementation
726(6)
Validating Data with set Functions
732(5)
Wrap-Up
737(7)
Classes: A Deeper Look, Part I
744(35)
Introduction
745(1)
Time Class Case Study
746(5)
Class Scope and Accessing Class Members
751(2)
Separating Interface from Implementation
753(2)
Access Functions and Utility Functions
755(2)
Time Class Case Study: Constructors with Default Arguments
757(6)
Destructors
763(1)
When Constructors and Destructors Are Called
764(3)
Time Class Case Study: A Subtle Trap---Returning a Reference to a private Data Member
767(3)
Default Memberwise Assignment
770(2)
Software Reusability
772(1)
Wrap-Up
773(6)
Classes: A Deeper Look, Part 2
779(48)
Introduction
780(1)
const (Constant) Objects and const Member Functions
780(10)
Composition: Objects as Members of Classes
790(7)
friend Functions and friend Classes
797(4)
Using the this Pointer
801(5)
Dynamic Memory Management with Operators new and delete
806(2)
static Class Members
808(6)
Data Abstraction and Information Hiding
814(3)
Example: Array Abstract Data Type
815(1)
Example: String Abstract Data Type
816(1)
Example: Queue Abstract Data Type
816(1)
Container Classes and Iterators
817(1)
Proxy Classes
817(4)
Wrap-Up
821(6)
Operator Overloading
827(41)
Introduction
828(1)
Fundamentals of Operator Overloading
829(1)
Restrictions on Operator Overloading
830(2)
Operator Functions as Class Members vs. Global Functions
832(1)
Overloading Stream Insertion and Stream Extraction Operators
833(4)
Overloading Unary Operators
837(1)
Overloading Binary Operators
837(1)
Case Study: Array Class
838(12)
Converting between Types
850(1)
Overloading ++ and --
851(1)
explicit Constructors
852(4)
Wrap-Up
856(12)
Object-Oriented Programming: Inheritance
868(53)
Introduction
869(1)
Base Classes and Derived Classes
870(3)
protected Members
873(1)
Relationship between Base Classes and Derived Classes
873(32)
Creating and Using a CommissionEmployee Class
874(5)
Creating a BasePlusCommissionEmployee Class Without Using Inheritance
879(6)
Creating a CommissionEmployee--BasePlusCommissionEmployee Inheritance Hierarchy
885(5)
CommissionEmployee--BasePlusCommissionEmployee Inheritance Hierarchy Using protected Data
890(7)
CommissionEmployee--BasePlusCommissionEmployee Inheritance Hierarchy Using private Data
897(8)
Constructors and Destructors in Derived Classes
905(8)
public, protected and private Inheritance
913(1)
Software Engineering with Inheritance
913(2)
Wrap-Up
915(6)
Object-Oriented Programming: Polymorphism
921(55)
Introduction
922(2)
Polymorphism Examples
924(1)
Relationships Among Objects in an Inheritance Hierarchy
925(17)
Invoking Base-Class Functions from Derived-Class Objects
925(8)
Aiming Derived-Class Pointers at Base-Class Objects
933(1)
Derived-Class Member-Function Calls via Base-Class Pointers
934(2)
Virtual Functions
936(6)
Summary of the Allowed Assignments Between Base-Class and Derived-Class Objects and Pointers
942(1)
Type Fields and switch Statements
942(1)
Abstract Classes and Pure virtual Functions
943(2)
Case Study: Payroll System Using Polymorphism
945(18)
Creating Abstract Base Class Employee
947(3)
Creating Concrete Derived Class SalariedEmployee
950(2)
Creating Concrete Derived Class HourlyEmployee
952(3)
Creating Concrete Derived Class CommissionEmployee
955(2)
Creating Indirect Concrete Derived Class BasePlusCommissionEmployee
957(2)
Demonstrating Polymorphic Processing
959(4)
(Optional) Polymorphism, Virtual Functions and Dynamic Binding ``Under the Hood''
963(4)
Case Study: Payroll System Using Polymorphism and Runtime Type Information with Downcasting, dynamic_cast, typeid and type_info
967(3)
Virtual Destructors
970(1)
Wrap-Up
971(5)
Templates
976(20)
Introduction
977(1)
Function Templates
978(3)
Overloading Function Templates
981(1)
Class Templates
981(7)
Nontype Parameters and Default Types for Class Templates
988(1)
Notes on Templates and Inheritance
989(1)
Notes on Templates and Friends
989(1)
Notes on Templates and static Members
990(1)
Wrap-Up
991(5)
Stream Input/Output
996(42)
Introduction
997(1)
Streams
998(4)
Classic Streams vs. Standard Streams
999(1)
iostream Library Header Files
999(1)
Stream Input/Output Classes and Objects
999(3)
Stream Output
1002(1)
Output of char * Variables
1002(1)
Character Output Using Member Function put
1002(1)
Stream Input
1003(4)
get and getline Member Functions
1004(3)
istream Member Functions peek, putback and ignore
1007(1)
Type-Safe I/O
1007(1)
Unformatted I/O Using read, write and gcount
1007(1)
Introduction to Stream Manipulators
1008(6)
Integral Stream Base: dec, oct, hex and setbase
1009(1)
Floating-Point Precision (precision, setprecision)
1010(1)
Field Width (width, setw)
1011(2)
User-Defined Output Stream Manipulators
1013(1)
Stream Format States and Stream Manipulators
1014(10)
Trailing Zeros and Decimal Points (showpoint)
1015(1)
Justification (left, right and internal)
1016(2)
Padding (fill, setfill)
1018(1)
Integral Stream Base (dec, oct, hex, showbase)
1019(1)
Floating-Point Numbers; Scientific and Fixed Notation (scientific, fixed)
1020(1)
Uppercase/Lowercase Control (uppercase)
1020(2)
Specifying Boolean Format (boolalpha)
1022(1)
Setting and Resetting the Format State via Member Function flags
1023(1)
Stream Error States
1024(3)
Tying an Output Stream to an Input Stream
1027(1)
Wrap-Up
1027(11)
Exception Handling
1038(32)
Introduction
1039(1)
Exception-Handling Overview
1040(1)
Example: Handling an Attempt to Divide by Zero
1040(7)
When to Use Exception Handling
1047(1)
Rethrowing an Exception
1048(1)
Exception Specifications
1049(1)
Processing Unexpected Exceptions
1050(1)
Stack Unwinding
1051(1)
Constructors, Destructors and Exception Handling
1052(1)
Exceptions and Inheritance
1053(1)
Processing new Failures
1053(4)
Class auto_ptr and Dynamic Memory Allocation
1057(3)
Standard Library Exception Hierarchy
1060(2)
Other Error-Handling Techniques
1062(1)
Wrap-Up
1062(8)
A. Internet and Web Resources
1070(12)
Free C/C++ Compilers and Development Tools
1070(1)
C Resource Sites
1071(1)
C99
1071(2)
C Projects, Freeware and Shareware
1073(1)
C Source Code
1073(1)
C Articles and Whitepapers
1073(1)
C Tutorials and Webcasts
1074(1)
GNOME and GLib
1075(1)
Swig
1076(1)
Objective-C
1076(1)
C Sample Chapters and eBooks
1077(1)
C Wikis
1077(1)
C FAQs
1077(1)
C Newsgroups
1078(1)
C Blogs
1078(1)
C Downloads from Download.com
1078(1)
C Game Programming
1078(1)
Allegro Game Programming Resources
1079(2)
Jobs for C Programmers
1081(1)
Deitel C Training
1081(1)
B. Operator Precedence Charts
1082(4)
C. ASCII Character Set
1086(1)
D. Number Systems
1087(13)
Introduction
1088(3)
Abbreviating Binary Numbers as Octal and Hexadecimal Numbers
1091(1)
Converting Octal and Hexadecimal Numbers to Binary Numbers
1092(1)
Converting from Binary, Octal or Hexadecimal to Decimal
1092(1)
Converting from Decimal to Binary, Octal or Hexadecimal
1093(2)
Negative Binary Numbers: Two's Complement Notation
1095(5)
E. Game Programming: Solving Sudoku
1100(9)
Index 1109

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program