CART

(0) items

C How to Program,9780130895721
This item qualifies for
FREE SHIPPING!

FREE SHIPPING OVER $59!

Your order must be $59 or more, you must select US Postal Service Shipping as your shipping preference, and the "Group my items into as few shipments as possible" option when you place your order.

Bulk sales, PO's, Marketplace Items, eBooks, Apparel, and DVDs not included.

C How to Program

by ;
Edition:
3rd
ISBN13:

9780130895721

ISBN10:
0130895725
Media:
Paperback w/CD
Pub. Date:
1/1/2001
Publisher(s):
PRENTICE HALL
List Price: $85.00

Buy Used Textbook

(Recommended)
In Stock Usually Ships in 24 Hours
$59.50

Buy New Textbook

Currently Available, Usually Ships in 24-48 Hours
$82.88

Rent Textbook

We're Sorry
Sold Out

eTextbook

We're Sorry
Not Available

More New and Used
from Private Sellers
Starting at $6.00

Questions About This Book?

What version or edition is this?
This is the 3rd edition with a publication date of 1/1/2001.
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 CDs, lab manuals, study guides, etc.
  • The Used copy of this book is not guaranteed to inclue any supplemental materials. Typically, only the book itself is included.

Summary

For CS1 and other courses covering programming in C. Also appropriate as a supplement for upper-level courses where the instructor uses a book as a reference to the C language.This comprehensive text is aimed at readers with little or no programming experience. Highly practical in approach, it introduces fundamental notions of structured programming and software engineering and gets up to speed quickly. The book covers not only the full C language, but includes a review of library functions and a solid introduction to C++, Java, and object-oriented programming.

Table of Contents

Preface xxx
Introduction to Computers, the Internet and the World Wide Web
1(25)
Introduction
2(2)
What Is a Computer?
4(1)
Computer Organization
4(1)
Evolution of Operating Systems
5(1)
Personal Computing, Distributed Computing and Client/Server Computing
6(1)
Machine Languages, Assembly Languages and High-level Languages
7(1)
The History of C
8(1)
The C Standard Library
9(1)
The Key Software Trend: Object Technology
10(1)
C++ and C++ How to Program
11(1)
Java and Java How to Program
12(1)
Other High-level Languages
13(1)
Structured Programming
13(1)
The Basics of a typical C Program Development Environment
14(2)
Hardware Trends
16(1)
History of the Internet
17(1)
History of the World Wide Web
18(1)
General Notes About C and this Book
19(7)
Introduction to C Programming
26(30)
Introduction
27(1)
A Simple C Program: Printing a Line of Text
27(4)
Another Simple C Program: Adding Two Integers
31(4)
Memory Concepts
35(2)
Arithmetic in C
37(3)
Decision Making: Equality and Relational Operators
40(16)
Structured Program Development in C
56(44)
Introduction
57(1)
Algorithms
57(1)
Pseudocode
58(1)
Control Structures
58(2)
The if Selection Structure
60(2)
The if/else Selection Structure
62(4)
The while Repetition Structure
66(1)
Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition)
67(2)
Formulating Algorithms with Top-down, Stepwise Refinement: Case Study 2 (Sentinel-Controlled Repetition)
69(6)
Formulating Algorithms with Top-down, Stepwise Refinement: Case Study 3 (Nested Control Structures)
75(2)
Assignment Operators
77(3)
Increment and Decrement Operators
80(20)
C Program Control
100(42)
Introduction
101(1)
The Essentials of Repetition
101(1)
Counter-Controlled Repetition
102(2)
The for Repetition Structure
104(2)
The for Structure: Notes and Observations
106(1)
Examples Using the for Structure
107(4)
The switch Multiple-Selection Structure
111(5)
The do/while Repetition Structure
116(2)
The break and continue Statements
118(2)
Logical Operators
120(2)
Confusing Equality (==) and Assignment (=) Operators
122(2)
Structured Programming Summary
124(18)
C Functions
142(54)
Introduction
143(1)
Program Modules in C
143(2)
Math Library Functions
145(1)
Functions
146(1)
Function Definitions
147(4)
Function Prototypes
151(2)
Header Files
153(1)
Calling Functions: Call by Value and Call by Reference
154(1)
Random Number Generation
155(4)
Example: A Game of Chance
159(3)
Storage Classes
162(2)
Scope Rules
164(3)
Recursion
167(3)
Example Using Recursion: The Fibonacci Series
170(4)
Recursion vs. Iteration
174(22)
C Arrays
196(53)
Introduction
197(1)
Arrays
197(2)
Declaring Arrays
199(1)
Examples Using Arrays
199(12)
Passing Arrays to Functions
211(5)
Sorting Arrays
216(2)
Case Study: Computing Mean, Median and Mode Using Arrays
218(3)
Searching Arrays
221(5)
Multiple-Subscripted Arrays
226(23)
C Pointers
249(57)
Introduction
250(1)
Pointer Variable Declarations and Initialization
250(1)
Pointer Operators
251(3)
Calling Functions by Reference
254(4)
Using the const Qualifier with Pointers
258(6)
Bubble Sort Using Call by Reference
264(5)
Pointer Expressions and Pointer Arithmetic
269(3)
The Relationship between Pointers and Arrays
272(4)
Arrays of Pointers
276(1)
Case Study: A Card Shuffling and Dealing Simulation
277(4)
Pointers to Functions
281(25)
C Characters and Strings
306(46)
Introduction
307(1)
Fundamentals of Strings and Characters
307(2)
Character Handling Library
309(5)
String Conversion Functions
314(5)
Standard Input/Output Library Functions
319(4)
String Manipulation Functions of the String Handling Library
323(2)
Comparison Functions of the String Handling Library
325(3)
Search Functions of the String Handling Library
328(5)
Memory Functions of the String Handling Library
333(4)
Other Functions of the String Handling Library
337(15)
C Formatted Input/Output
352(28)
Introduction
353(1)
Streams
353(1)
Formatting Output with printf
354(1)
Printing Integers
354(2)
Printing Floating-Point Numbers
356(1)
Printing Strings and Characters
357(1)
Other Conversion Specifiers
358(2)
Printing with Field Widths and Precisions
360(2)
Using Flags in the printf Format-Control String
362(3)
Printing Literals and Escape Sequences
365(1)
Formatting Input with scanf
366(14)
C Structures, Unions, Bit Manipulations and Enumerations
380(35)
Introduction
381(1)
Structure Definitions
381(3)
Initializing Structures
384(1)
Accessing Members of Structures
384(2)
Using Structures with Functions
386(1)
typedef
386(1)
Example: High-Performance Card Shuffling and Dealing Simulation
387(2)
Unions
389(3)
Bitwise Operators
392(8)
Bit Fields
400(3)
Enumeration Constants
403(12)
C File Processing
415(35)
Introduction
416(1)
The Data Hierarchy
416(2)
Files and Streams
418(1)
Creating a Sequential-Access File
419(5)
Reading Data from a Sequential-Access File
424(5)
Random-Access Files
429(1)
Creating a Randomly Accessed File
429(2)
Writing Data Randomly to a Randomly Accessed File
431(2)
Reading Data Randomly from a Randomly Accessed File
433(2)
Case Study: A Transaction-Processing Program
435(15)
C Data Structures
450(52)
Introduction
451(1)
Self-Referential Structures
452(1)
Dynamic Memory Allocation
452(2)
Linked Lists
454(7)
Stacks
461(6)
Queues
467(6)
Trees
473(29)
C Preprocessor
502(12)
Introduction
503(1)
The #include Preprocessor Directive
503(1)
The #define Preprocessor Directive: Symbolic Constants
504(1)
The #define Preprocessor Directive: Macros
504(2)
Conditional Compilation
506(1)
The #error and #pragma Preprocessor Directives
507(1)
The # and ## Operators
507(1)
Line Numbers
508(1)
Predefined Symbolic Constants
508(1)
Assertions
509(5)
Advanced C Topics
514(22)
Introduction
515(1)
Redirecting Input/Output on UNIX and DOS Systems
515(1)
Variable-Length Argument Lists
516(2)
Using Command-Line Arguments
518(2)
Notes on Compiling Multiple-Source-File Programs
520(1)
Program Termination with exit and atexit
521(2)
The volatile Type Qualifier
523(1)
Suffixes for Integer and Floating-Point Constants
523(1)
More on Files
523(3)
Signal Handling
526(2)
Dynamic Memory Allocation: Functions calloc and realloc
528(1)
The Unconditional Branch: goto
529(7)
C++ as a ``Better C''
536(27)
Introduction
537(1)
C++
537(1)
A Simple Program: Adding Two Integers
538(2)
C++ Standard Library
540(1)
Header Files
541(2)
Inline Functions
543(2)
References and Reference Parameters
545(4)
Default Arguments and Empty Parameter Lists
549(2)
Unary Scope Resolution Operator
551(3)
Function Overloading
554(1)
Function Templates
555(8)
C++ Classes and Data Abstraction
563(47)
Introduction
564(1)
Implementing a Time Abstract Data Type with a Class
565(7)
Class Scope and Accessing Class Members
572(1)
Separating Interface from Implementation
573(4)
Controlling Access to Members
577(3)
Access Functions and Utility Functions
580(3)
Initializing Class Objects: Constructors
583(1)
Using Default Arguments with Constructors
584(4)
Using Destructors
588(1)
When Constructors and Destructors Are Called
588(3)
Using Data Members and Member Functions
591(5)
A Subtle Trap: Returning a Reference to a private Data Member
596(2)
Assignment by Default Memberwise Copy
598(2)
Software Reusability
600(10)
C++ Classes: Part II
610(40)
Introduction
611(1)
const (Constant) Objects and const Member Functions
611(9)
Composition: Objects as Members of Classes
620(5)
friend Functions and friend Classes
625(3)
Using the this Pointer
628(5)
Dynamic Memory Allocation with Operators new and delete
633(2)
static Class Members
635(5)
Data Abstraction and Information Hiding
640(3)
Example: Array Abstract Data Type
641(1)
Example: String Abstract Data Type
642(1)
Example: Queue Abstract Data Type
642(1)
Container Classes and Iterators
643(7)
C++ Operator Overloading
650(32)
Introduction
651(1)
Fundamentals of Operator Overloading
652(1)
Restrictions on Operator Overloading
653(2)
Operator Functions as Class Members vs. as friend Functions
655(1)
Overloading Stream-Insertion and Stream-Extraction Operators
656(3)
Overloading Unary Operators
659(1)
Overloading Binary Operators
659(1)
Case Study: An Array Class
660(12)
Converting between Types
672(1)
Overloading ++ and --
673(9)
C++ Inheritance
682(38)
Introduction
683(2)
Inheritance: Base Classes and Derived Classes
685(2)
Protected Members
687(1)
Casting Base-Class Pointers to Derived-Class Pointers
687(6)
Using Member Functions
693(1)
Overriding Base-Class Members in a Derived Class
693(5)
Public, Protected and Private Inheritance
698(1)
Direct Base Classes and Indirect Base Classes
699(1)
Using Constructors and Destructors in Derived Classes
699(4)
Implicit Derived-Class Object to Base-Class Object Conversion
703(1)
Software Engineering with Inheritance
704(1)
Composition vs. Inheritance
705(1)
``Uses A'' and ``Knows A'' Relationships
706(1)
Case Study: Point, Circle, Cylinder
706(14)
C++ Virtual Functions and Polymorphism
720(23)
Introduction
721(1)
Type Fields and switch Statements
721(1)
Virtual Functions
722(1)
Abstract Base Classes and Concrete Classes
723(1)
Polymorphism
723(2)
New Classes and Dynamic Binding
725(1)
Virtual Destructors
726(1)
Case Study: Inheriting Interface and Implementation
726(9)
Polymorphism, virtual Functions and Dynamic Binding ``Under the Hood''
735(8)
C++ Stream Input/Output
743(45)
Introduction
745(1)
Streams
745(3)
Iostream Library Header Files
746(1)
Stream Input/Output Classes and Objects
746(2)
Stream Output
748(4)
Stream-Insertion Operator
748(2)
Cascading Stream-Insertion/Extraction Operators
750(1)
Output of char * Variables
751(1)
Character Output with Member Function put; Cascading puts
752(1)
Stream Input
752(6)
Stream-Extraction Operator
752(3)
get and getline Member Functions
755(3)
istream Member Functions peek, putback and ignore
758(1)
Type-Safe I/O
758(1)
Unformatted I/O with read, gcount and write
758(1)
Stream Manipulators
759(5)
Integral Stream Base: dec, oct, hex and setbase
759(1)
Floating-Point Precision (precision, setprecision)
760(2)
Field Width (setw, width)
762(1)
User-Defined Manipulators
763(1)
Stream Format States
764(10)
Format State Flags
764(1)
Trailing Zeros and Decimal Points (ios: : showpoint)
765(1)
Justification (ios::left, ios::right, ios::internal)
766(2)
Padding (fill, setfill)
768(2)
Integral Stream Base (ios::dec, ios::oct, ios::hex, ios::showbase)
770(1)
Floating-Point Numbers; Scientific Notation (ios::scientific, ios::fixed)
771(1)
Uppercase/Lowercase Control (ios::uppercase)
772(1)
Setting and Resetting the Format Flags (flags, setiosflags, resetiosflags)
772(2)
Stream Error States
774(2)
Typing an Output Stream to an Input Stream
776(12)
C++ Templates
788(13)
Introduction
789(1)
Class Templates
789(6)
Class Templates and Nontype Parameters
795(1)
Templates and Inheritance
796(1)
Templates and friends
796(1)
Templates and static Members
797(4)
C++ Exception Handling
801(33)
Introduction
802(2)
When Exception Handling Should Be Used
804(1)
Other Error-Handling Techniques
805(1)
Basics of C++ Exception-Handling: try, throw, catch
806(1)
A Simple Exception-Handling Example: Divide by Zero
806(3)
Throwing an Exception
809(1)
Catching an Exception
810(3)
Rethrowing an Exception
813(2)
Exception Specifications
815(1)
Processing Unexpected Exceptions
815(1)
Stack Unwinding
816(1)
Constructors, Destructors and Exception Handling
817(1)
Exceptions and Inheritance
818(1)
Processing new Failures
818(4)
Class auto_ptr and Dynamic Memory Allocation
822(2)
Standard Library Exception Hierarchy
824(10)
Introduction to Java Applications and Applets
834(54)
Introduction
835(1)
Basics of a Typical Java Environment
836(3)
General Notes about Java and This Book
839(1)
A Simple Program: Printing a Line of Text
840(8)
Another Java Application: Adding Integers
848(5)
Sample Applets from the Java 2 Software Development Kit
853(6)
The TicTacToe Applet
854(2)
The DrawTest Applet
856(2)
The Java2D Applet
858(1)
A Simple Java Applet: Drawing a String
859(7)
Two More Simple Applets: Drawing Strings and Lines
866(2)
Another Java Applet: Adding Integers
868(20)
Beyond C & C++: Operators, Methods & Arrays in Java
888(58)
Introduction
889(1)
Primitive Data Types and Keywords
889(2)
Logical Operators
891(5)
Method Definitions
896(5)
Java API Packages
901(5)
Random Number Generation
906(3)
Example: A Game of Chance
909(8)
Methods of Class JApplet
917(2)
Declaring and Allocating Arrays
919(1)
Examples Using Arrays
920(9)
References and Reference Parameters
929(2)
Multiple-Subscripted Arrays
931(15)
Java Object-Based Programming
946(38)
Introduction
947(1)
Implementing a Time Abstract Data Type with a Class
948(8)
Class Scope
956(1)
Creating Packages
956(4)
Initializing Class Objects: Constructors
960(1)
Using Set and Get Methods
961(7)
Using the this Reference
968(3)
Finalizers
971(1)
Static Class Members
971(13)
Java Object-Oriented Programming
984(53)
Introduction
985(2)
Superclasses and Subclasses
987(2)
protected Members
989(1)
Relationship between Superclass Objects and Subclass Objects
989(8)
Implicit Subclass-Object-to-Superclass-Object Conversion
997(1)
Software Engineering with Inheritance
997(2)
Composition vs. Inheritance
999(1)
Introduction to Polymorphism
999(1)
Type Fields and switch Statements
999(1)
Dynamic Method Binding
999(1)
final Methods and Classes
1000(1)
Abstract Superclasses and Concrete Classes
1000(1)
Polymorphism Example
1001(2)
New Classes and Dynamic Binding
1003(1)
Case Study: Inheriting Interface and Implementation
1004(6)
Case Study: Creating and Using Interfaces
1010(5)
Inner Class Definitions
1015(11)
Notes on Inner Class Definitions
1026(1)
Type-Wrapper Classes for Primitive Types
1026(11)
Java Graphics and Java2D
1037(41)
Introduction
1038(2)
Graphics Contexts and Graphics Objects
1040(1)
Color Control
1041(7)
Font Control
1048(6)
Drawing Lines, Rectangles and Ovals
1054(4)
Drawing Arcs
1058(2)
Drawing Polygons and Polylines
1060(3)
The Java2D API
1063(1)
Java2D Shapes
1063(15)
Java Graphical User Interface Components
1078(72)
Introduction
1079(2)
Swing Overview
1081(2)
JLabel
1083(3)
Event Handling Model
1086(2)
JTextField and JPasswordField
1088(6)
How Event Handling Works
1093(1)
JTextArea
1094(3)
JButton
1097(4)
JCheckBox
1101(3)
JComboBox
1104(2)
Mouse Event Handling
1106(5)
Layout Managers
1111(8)
FlowLayout
1111(3)
BorderLayout
1114(3)
GridLayout
1117(2)
Panels
1119(2)
Creating a Self-Contained Subclass of JPanel
1121(6)
Windows
1127(2)
Using Menus with Frames
1129(21)
Java Multimedia: Images, Animation and Audio
1150(30)
Introduction
1151(1)
Loading, Displaying and Scaling Images
1152(3)
Loading and Playing Audio Clips
1155(3)
Animating a Series of Images
1158(4)
Animation Issues
1162(2)
Customizing Applets via the HTML param Tag
1164(5)
Image Maps
1169(2)
Java Plug-In
1171(3)
Internet and World Wide Web Resources
1174(6)
A Internet and Web Resources 1180(11)
A.1 C/C++ Resources
1180(1)
A.2 C++ Tutorials
1181(1)
A.3 C/C++ FAQs
1182(1)
A.4 Visual C++
1182(1)
A.5 comp.lang.c++
1182(2)
A.6 C/C++ Compilers
1184(1)
A.7 C++ Development Tools
1185(1)
A.8 Java Resources
1185(2)
A.9 Java Products
1187(1)
A.10 Java FAQs
1187(1)
A.11 Java Tutorials
1187(1)
A.12 Java Magazines
1188(1)
A.13 Java Applets
1188(1)
A.14 Multimedia
1189(1)
A.15 Java Newsgroups
1189(2)
B C99 Internet and Web Resources 1191(2)
B.1 C99 Resources
1191(2)
C Operator Precedence Charts 1193(5)
D ASCII Character Set 1198(1)
E Number Systems 1199(13)
E.1 Introduction
1200(3)
E.2 Abbreviating Binary Numbers as Octal Numbers and Hexadecimal Numbers
1203(1)
E.3 Converting Octal Numbers and Hexadecimal Numbers to Binary Numbers
1204(1)
E.4 Converting from Binary, Octal, or Hexadecimal to Decimal
1204(1)
E.5 Converting from Decimal to Binary, Octal, or Hexadecimal
1205(1)
E.6 Negative Binary Numbers: Two's Complement Notation
1206(6)
Index 1212

Excerpts

PrefaceWelcome to ANSI/ISO Standard C, and to C++ and Java , too! This book is by an old guy and a young guy. The old guy (HMD; Massachusetts Institute of Technology 1967) has been programming and/or teaching programming for 39 years. The young guy (PJD; MIT 1991) has been programming for 18 years and has .caught the teaching and writing "bug." The old guy programs and teaches from experience; the young guy does so from an inexhaustible reserve of energy. The old guy wants clarity; the young guy wants performance. The old guy appreciates elegance and beauty; the young guy wants results. We got together to produce a book we hope you will find informative, interesting and entertaining. Why We Wrote C How to Program:In most educational environments, C is taught to people who know how to program. Many educators believe that the complexity of C, and a number of other difficulties, make C unworthy for a first programming course--precisely the target course for this book. So why did we write this text?Dr. Harvey M. Deitel taught introductory programming courses in college environments for two decades with an emphasis on developing clearly written, well-structured programs. Much of what is taught in these courses is the basic principles of structured programming, with an emphasis on the effective use of control structures and functionalization. We have presented this material exactly the way HMD has done in his college courses. Students are highly motivated by the fact that they are learning a language that will be immediately useful to them as they leave the university environment.Our goal was clear: Produce a C programming textbook for introductory university-level courses in computer programming for students with little or no programming experience, yet offer the deep and rigorous treatment of theory and practice demanded by traditional C courses. To meet these goals, we produced a book larger than other C texts--this because our text also patiently teaches structured programming principles. Hundreds of thousands of students worldwide learned C from the earlier editions of this book.The book contains a rich collection of examples, exercises and projects drawn from many fields to provide the student with a chance to solve interesting real-world problems. The book also concentrates on the principles of good software engineering and stresses program clarity through use of the structured programming methodology. We teach by example. C How to Program: Third EditionThe material fromC How to Program: Third Editionhas been meticulously reviewed by many industry and academic experts, including the head of the ANSI C committee. We have considerably polished the material from the second edition, especially the chapter on pointers.In the second edition ofC How to Program,we included a seven-chapter introduction to C++ and Object-Oriented Programming. In the interim, many universities have decided to incorporate an introduction to C++ and Object-Oriented Programming into their C courses. So in this edition, we have expanded our C++ treatment to nine chapters--sufficient text, exercises and laboratories for a one-semester course. We have also added seven chapters on object-oriented programming with Java, including discussions of graphics programming, graphical user interface (GUI) with Java Swing components and multimedia programming.In 1999, the International Standards Organization approved anew version of C, known as C99; but as of this writing, no C99 compilers were available. Therefore, we were not able to make our code examples compatible with C99. When C99 compilers become available, we will test every program in the textbook and list any discrepancies on our Web site (www.deitel.com). We will also post code examples with explanations of the new C99 features on that Web site. Appendix B contain


Please wait while the item is added to your cart...