Presentation is loading. Please wait.

Presentation is loading. Please wait.

 2003 Prentice Hall, Inc. All rights reserved. 1.

Similar presentations


Presentation on theme: " 2003 Prentice Hall, Inc. All rights reserved. 1."— Presentation transcript:

1  2003 Prentice Hall, Inc. All rights reserved. 1

2 2 C++ How to Program 4/e Author: Deitel Prentice Hall, Inc. Review 1.Presents an easy introduction to C++ programming, by using trivial examples: –Going from basic C (chapters 1-5) to OO concepts (chapters 6 and 7). –Covers all topics in great detail. 2.C++ mainly in chapters 8, 9 and Templates in chapter Advanced topics in chapters Data Structures chapter STL chapter 21.

3  2003 Prentice Hall, Inc. All rights reserved. 3 Chapter 1 – Introduction to Computers and C++ Programming Outline 1.1 Introduction 1.2 What is a Computer? 1.3 Computer Organization 1.4 Evolution of Operating Systems 1.5 Personal Computing, Distributed Computing and Client/Server Computing 1.6 Machine Languages, Assembly Languages, and High-Level Languages 1.7 History of C and C C++ Standard Library 1.9 Java 1.10 Visual Basic, Visual C++ and C# 1.11 Other High-Level Languages 1.12 Structured Programming 1.13 The Key Software Trend: Object Technology 1.14 Basics of a Typical C++ Environment 1.15 Hardware Trends

4  2003 Prentice Hall, Inc. All rights reserved. 4 Chapter 1 – Introduction to Computers and C++ Programming Outline 1.16 History of the Internet 1.17 History of the World Wide Web 1.18 World Wide Web Consortium (W3C) 1.19 General Notes About C++ and This Book 1.20 Introduction to C++ Programming 1.21 A Simple Program: Printing a Line of Text 1.22 Another Simple Program: Adding Two Integers 1.23 Memory Concepts 1.24 Arithmetic 1.25 Decision Making: Equality and Relational Operators 1.26 Thinking About Objects: Introduction to Object Technology and the Unified Modeling Language

5  2003 Prentice Hall, Inc. All rights reserved. 5 Chapter 2 - Control Structures Outline 2.1 Introduction 2.2 Algorithms 2.3 Pseudocode 2.4 Control Structures 2.5 if Selection Structure 2.6 if/else Selection Structure 2.7 while Repetition Structure 2.8 Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition) 2.9 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 2 (Sentinel-Controlled Repetition) 2.10 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 3 (Nested Control Structures) 2.11 Assignment Operators 2.12 Increment and Decrement Operators 2.13 Essentials of Counter-Controlled Repetition 2.14 for Repetition Structure 2.15 Examples Using the for Structure

6  2003 Prentice Hall, Inc. All rights reserved. 6 Chapter 2 - Control Structures Outline 2.16 switch Multiple-Selection Structure 2.17 do/while Repetition Structure 2.18 break and continue Statements 2.19 Logical Operators 2.20 Confusing Equality (==) and Assignment (=) Operators 2.21 Structured-Programming Summary

7  2003 Prentice Hall, Inc. All rights reserved. 7 Chapter 3 - Functions Outline 3.1Introduction 3.2Program Components in C++ 3.3Math Library Functions 3.4Functions 3.5Function Definitions 3.6Function Prototypes 3.7Header Files 3.8Random Number Generation 3.9Example: A Game of Chance and Introducing enum 3.10Storage Classes 3.11Scope Rules 3.12Recursion 3.13Example Using Recursion: The Fibonacci Series 3.14Recursion vs. Iteration 3.15Functions with Empty Parameter Lists

8  2003 Prentice Hall, Inc. All rights reserved. 8 Chapter 3 - Functions Outline 3.16Inline Functions 3.17References and Reference Parameters 3.18Default Arguments 3.19Unary Scope Resolution Operator 3.20Function Overloading 3.21Function Templates

9  2003 Prentice Hall, Inc. All rights reserved. 9 Chapter 4 - Arrays Outline 4.1Introduction 4.2Arrays 4.3Declaring Arrays 4.4Examples Using Arrays 4.5Passing Arrays to Functions 4.6Sorting Arrays 4.7Case Study: Computing Mean, Median and Mode Using Arrays 4.8Searching Arrays: Linear Search and Binary Search 4.9Multiple-Subscripted Arrays

10  2003 Prentice Hall, Inc. All rights reserved. 10 Chapter 5 - Pointers and Strings Outline 5.1 Introduction 5.2 Pointer Variable Declarations and Initialization 5.3 Pointer Operators 5.4 Calling Functions by Reference 5.5 Using const with Pointers 5.6 Bubble Sort Using Pass-by-Reference 5.7 Pointer Expressions and Pointer Arithmetic 5.8 Relationship Between Pointers and Arrays 5.9 Arrays of Pointers 5.10 Case Study: Card Shuffling and Dealing Simulation 5.11 Function Pointers 5.12 Introduction to Character and String Processing Fundamentals of Characters and Strings String Manipulation Functions of the String- Handling Library

11  2003 Prentice Hall, Inc. All rights reserved. 11 Chapter 6: Classes and Data Abstraction Outline 6.1 Introduction 6.2 Structure Definitions 6.3 Accessing Structure Members 6.4 Implementing a User-Defined Type Time with a struct 6.5 Implementing a Time Abstract Data Type with a class 6.6 Class Scope and Accessing Class Members 6.7 Separating Interface from Implementation 6.8 Controlling Access to Members 6.9 Access Functions and Utility Functions 6.10 Initializing Class Objects: Constructors 6.11 Using Default Arguments with Constructors 6.12 Destructors 6.13 When Constructors and Destructors Are Called 6.14 Using Set and Get Functions 6.15 Subtle Trap: Returning a Reference to a private Data Member 6.16 Default Memberwise Assignment 6.17 Software Reusability

12  2003 Prentice Hall, Inc. All rights reserved. 12 Chapter 7: Classes Part II Outline 7.1 Introduction 7.2 const (Constant) Objects and const Member Functions 7.3 Composition: Objects as Members of Classes 7.4 friend Functions and friend Classes 7.5 Using the this Pointer 7.6 Dynamic Memory Management with Operators new and delete 7.7 static Class Members 7.8 Data Abstraction and Information Hiding Example: Array Abstract Data Type Example: String Abstract Data Type Example: Queue Abstract Data Type 7.9 Container Classes and Iterators 7.10 Proxy Classes

13  2003 Prentice Hall, Inc. All rights reserved. 13 Chapter 8 - Operator Overloading Outline 8.1Introduction 8.2Fundamentals of Operator Overloading 8.3Restrictions on Operator Overloading 8.4Operator Functions as Class Members vs. as friend Functions 8.5Overloading Stream-Insertion and Stream-Extraction Operators 8.6Overloading Unary Operators 8.7Overloading Binary Operators 8.8Case Study: Array Class 8.9Converting between Types 8.10Case Study: A String Class 8.11Overloading ++ and Case Study: A Date Class 8.13Standard Library Classes string and vector

14  2003 Prentice Hall, Inc. All rights reserved. 14 Chapter 9 - Object-Oriented Programming: Inheritance Outline 9.1 Introduction 9.2 Base Classes and Derived Classes 9.3 protected Members 9.4 Relationship between Base Classes and Derived Classes 9.5 Case Study: Three-Level Inheritance Hierarchy 9.6 Constructors and Destructors in Derived Classes 9.7 “Uses A” and “Knows A” Relationships 9.8 public, protected and private Inheritance 9.9 Software Engineering with Inheritance

15  2003 Prentice Hall, Inc. All rights reserved. 15 Chapter 10 - Object-Oriented Programming: Polymorphism Outline 10.1 Introduction 10.2 Relationships Among Objects in an Inheritance Hierarchy Invoking Base-Class Functions from Derived-Class Objects Aiming Derived-Class Pointers at Base-Class Objects Derived-Class Member-Function Calls via Base-Class Pointers Virtual Functions 10.3 Polymorphism Examples 10.4 Type Fields and switch Structures 10.5 Abstract Classes 10.6 Case Study: Inheriting Interface and Implementation 10.7 Polymorphism, Virtual Functions and Dynamic Binding “Under the Hood” 10.8 Virtual Destructors

16  2003 Prentice Hall, Inc. All rights reserved. 16 Chapter 11 - Templates Outline 11.1 Introduction 11.2 Function Templates 11.3 Overloading Function Templates 11.4 Class Templates 11.5 Class Templates and Nontype Parameters 11.6 Templates and Inheritance 11.7 Templates and Friends 11.8 Templates and static Members

17  2003 Prentice Hall, Inc. All rights reserved. 17 Chapter 12 - C++ Stream Input/Output Outline 12.1 Introduction 12.2 Streams Classic Streams vs. Standard Streams iostream Library Header Files Stream Input/Output Classes and Objects 12.3 Stream Output Output of char * Variables Character Output using Member Function put 12.4 Stream Input get and getline Member Functions istream Member Functions peek, putback and ignore Type-Safe I/O 12.5 Unformatted I/O using read, write and gcount

18  2003 Prentice Hall, Inc. All rights reserved. 18 Chapter 12 - C++ Stream Input/Output Outline 12.6 Introduction to Stream Manipulators Integral Stream Base: dec, oct, hex and setbase Floating-Point Precision (precision, setprecision) Field Width (width, setw) Programmer-Defined Manipulators 12.7 Stream Format States and Stream Manipulators Trailing Zeros and Decimal Points (showpoint) Justification (left, right and internal) Padding (fill, setfill) Integral Stream Base (dec, oct, hex, showbase) Floating-Point Numbers; Scientific and Fixed Notation (scientific, fixed) Uppercase/Lowercase Control (uppercase) Specifying Boolean Format (boolalpha) Setting and Resetting the Format State via Member-Function flags 12.8 Stream Error States 12.9 Tying an Output Stream to an Input Stream

19  2003 Prentice Hall, Inc. All rights reserved. 19 Chapter 13 - Exception Handling Outline 13.1 Introduction 13.2 Exception-Handling Overview 13.3 Other Error-Handling Techniques 13.4 Simple Exception-Handling Example: Divide by Zero 13.5 Rethrowing an Exception 13.6 Exception Specifications 13.7 Processing Unexpected Exceptions 13.8 Stack Unwinding 13.9 Constructors, Destructors and Exception Handling Exceptions and Inheritance Processing new Failures Class auto_ptr and Dynamic Memory Allocation Standard Library Exception Hierarchy

20  2003 Prentice Hall, Inc. All rights reserved. 20 Chapter 14 - File Processing Outline 14.1 Introduction 14.2 The Data Hierarchy 14.3 Files and Streams 14.4 Creating a Sequential-Access File 14.5 Reading Data from a Sequential-Access File 14.6 Updating Sequential-Access Files 14.7 Random-Access Files 14.8 Creating a Random-Access File 14.9 Writing Data Randomly to a Random-Access File Reading Data Sequentially from a Random-Access File Example: A Transaction-Processing Program Input/Output of Objects

21  2003 Prentice Hall, Inc. All rights reserved. 21 Chapter 15 - Class string and String Stream Processing Outline 15.1 Introduction 15.2 string Assignment and Concatenation 15.3 Comparing strings 15.4 Substrings 15.5 Swapping strings 15.6 string Characteristics 15.7 Finding Strings and Characters in a string 15.8 Replacing Characters in a string 15.9 Inserting Characters into a string Conversion to C-Style char * Strings Iterators String Stream Processing

22  2003 Prentice Hall, Inc. All rights reserved. 22 Chapter 16 - Web Programming with CGI Outline 16.1 Introduction 16.2 HTTP Request Types 16.3 Multi-Tier Architecture 16.4 Accessing Web Servers 16.5 Apache HTTP Server 16.6 Requesting XHTML Documents 16.7 Introduction to CGI 16.8 Simple HTTP Transaction 16.9 Simple CGI Script Sending Input to a CGI Script Using XHTML Forms to Send Input Other Headers Case Study: An Interactive Web Page Cookies Server-Side Files Case Study: Shopping Cart Internet and Web Resources

23  2003 Prentice Hall, Inc. All rights reserved. 23 Chapter 17 - Data Structures Outline 17.1 Introduction 17.2 Self-Referential Classes 17.3 Dynamic Memory Allocation and Data Structures 17.4 Linked Lists 17.5 Stacks 17.6 Queues 17.7 Trees

24  2003 Prentice Hall, Inc. All rights reserved. 24 Chapter 18 - Bits, Characters, Strings and Structures Outline 18.1 Introduction 18.2 Structure Definitions 18.3 Initializing Structures 18.4 Using Structures with Functions 18.5 typedef 18.6 Example: High-Performance Card-Shuffling and Dealing Simulation 18.7 Bitwise Operators 18.8 Bit Fields 18.9 Character-Handling Library String-Conversion Functions Search Functions of the String-Handling Library Memory Functions of the String-Handling Library

25  2003 Prentice Hall, Inc. All rights reserved. 25 Chapter 19 - The Preprocessor Outline 19.1 Introduction 19.2 The #include Preprocessor Directive 19.3 The #define Preprocessor Directive: Symbolic Constants 19.4 The #define Preprocessor Directive: Macros 19.5 Conditional Compilation 19.6 The #error and #pragma Preprocessor Directives 19.7 The # and ## Operators 19.8 Line Numbers 19.9 Predefined Symbolic Constants Assertions

26  2003 Prentice Hall, Inc. All rights reserved. 26 Chapter 20 - C Legacy Code Topics Outline 20.1 Introduction 20.2 Redirecting Input/Output on UNIX and DOS Systems 20.3 Variable-Length Argument Lists 20.4 Using Command-Line Arguments 20.5 Notes on Compiling Multiple-Source-File Programs 20.6 Program Termination with exit and atexit 20.7 The volatile Type Qualifier 20.8 Suffixes for Integer and Floating-Point Constants 20.9 Signal Handling Dynamic Memory Allocation with calloc and realloc The Unconditional Branch: goto Unions Linkage Specifications

27  2003 Prentice Hall, Inc. All rights reserved. 27 Chapter 21 - Standard Template Library (STL) Outline 21.1 Introduction to the Standard Template Library (STL) Introduction to Containers Introduction to Iterators Introduction to Algorithms 21.2 Sequence Containers vector Sequence Container list Sequence Container deque Sequence Container 21.3 Associative Containers multiset Associative Container set Associative Container multimap Associative Container map Associative Container 21.4 Container Adapters stack Adapter queue Adapter priority_queue Adapter

28  2003 Prentice Hall, Inc. All rights reserved. 28 Chapter 21 - Standard Template Library (STL) 21.5 Algorithms fill, fill_n, generate and generate_n equal, mismatch and lexicographical_compare remove, remove_if, remove_copy and remove_copy_if replace, replace_if, replace_copy and replace_copy_if Mathematical Algorithms Basic Searching and Sorting Algorithms swap, iter_swap and swap_ranges copy_backward, merge, unique and reverse inplace_merge, unique_copy and reverse_copy Set Operations lower_bound, upper_bound and equal_range Heapsort min and max Algorithms Not Covered in This Chapter 21.6 Class bitset 21.7 Function Objects

29  2003 Prentice Hall, Inc. All rights reserved. 29 Chapter 22 - Other Topics Outline 22.1 Introduction 22.2 const_cast Operator 22.3 reinterpret_cast Operator 22.4 namespaces 22.5 Operator Keywords 22.6 explicit Constructors 22.7 mutable Class Members 22.8 Pointers to Class Members (.* and ->*) 22.9 Multiple Inheritance Multiple Inheritance and virtual Base Classes


Download ppt " 2003 Prentice Hall, Inc. All rights reserved. 1."

Similar presentations


Ads by Google