Welcome to UE Central Library

Keep Smiling

C : how to program / P.J. Deitel, H.M. Deitel.

By: Contributor(s): Material type: TextTextPublication details: New Delhi : Pearson Prentice Hall, 2008Edition: 5th edDescription: xxxi, 1110 p. ill. ; 24 cm. +ISBN:
  • 0132404168
  • 9780132404167
  • 9788131718803 (pbk)
Subject(s): DDC classification:
  • 005.133 22 D3686
Contents:
Preface xxi1 Introduction to Computers, the Internet andtheWeb 11.1 Introduction 21.2 What Is a Computer? 41.3 Computer Organization 41.4 Early Operating Systems 51.5 Personal, Distributed and Client/Server Computing 61.6 Machine Languages, Assembly Languages and High-Level Languages 61.7 Fortran, COBOL, Pascal and Ada 81.8 History of C 81.9 C Standard Library 91.10 C++ 101.11 Java 111.12 BASIC, Visual Basic, Visual C++, Visual C# and .NET 111.13 Key Software Trend: Object Technology 121.14 Typical C Program Development Environment 131.15 Hardware Trends 161.16 History of the Internet 161.17 History of the World Wide Web 181.18 Notes About C and This Book 181.19 Web Resources 192 Introduction to C Programming 322.1 Introduction 332.2 A Simple C Program: Printing a Line of Text 332.3 Another Simple C Program: Adding Two Integers 372.4 Memory Concepts 422.5 Arithmetic in C 432.6 Decision Making: Equality and Relational Operators 473 Structured Program Development in C 623.1 Introduction 633.2 Algorithms 63Contentsx Contents3.3 Pseudocode 643.4 Control Structures 643.5 The if Selection Statement 663.6 The if...else Selection Statement 683.7 The while Repetition Statement 713.8 Formulating Algorithms Case Study 1: Counter-Controlled Repetition 723.9 Formulating Algorithms with Top-Down, Stepwise RefinementCase Study 2: Sentinel-Controlled Repetition 753.10 Formulating Algorithms with Top-Down, Stepwise RefinementCase Study 3: Nested Control Structures 813.11 Assignment Operators 853.12 Increment and Decrement Operators 854 C Program Control 1074.1 Introduction 1084.2 Repetition Essentials 1084.3 Counter-Controlled Repetition 1094.4 for Repetition Statement 1114.5 for Statement: Notes and Observations 1134.6 Examples Using the for Statement 1144.7 switch Multiple-Selection Statement 1184.8 do...while Repetition Statement 1244.9 break and continue Statements 1264.10 Logical Operators 1284.11 Confusing Equality (==) and Assignment (=) Operators 1304.12 Structured Programming Summary 1325 C Functions 1515.1 Introduction 1525.2 Program Modules in C 1525.3 Math Library Functions 1535.4 Functions 1555.5 Function Definitions 1565.6 Function Prototypes 1605.7 Function Call Stack and Activation Records 1625.8 Headers 1635.9 Calling Functions: Call-by-Value and Call-by-Reference 1645.10 Random Number Generation 1655.11 Example: A Game of Chance 1705.12 Storage Classes 1745.13 Scope Rules 1765.14 Recursion 1795.15 Example Using Recursion: Fibonacci Series 1835.16 Recursion vs. Iteration 186Contents xi6 C Arrays 2086.1 Introduction 2096.2 Arrays 2096.3 Defining Arrays 2116.4 Array Examples 2116.5 Passing Arrays to Functions 2256.6 Sorting Arrays 2296.7 Case Study: Computing Mean, Median and Mode Using Arrays 2326.8 Searching Arrays 2356.9 Multiple-Subscripted Arrays 2427 C Pointers 2677.1 Introduction 2687.2 Pointer Variable Definitions and Initialization 2687.3 Pointer Operators 2697.4 Passing Arguments to Functions by Reference 2727.5 Using the const Qualifier with Pointers 2767.6 Bubble Sort Using Call-by-Reference 2827.7 sizeof Operator 2857.8 Pointer Expressions and Pointer Arithmetic 2887.9 Relationship between Pointers and Arrays 2907.10 Arrays of Pointers 2957.11 Case Study: Card Shuffling and Dealing Simulation 2957.12 Pointers to Functions 3008 C Characters and Strings 3258.1 Introduction 3268.2 Fundamentals of Strings and Characters 3268.3 Character-Handling Library 3288.4 String-Conversion Functions 3338.5 Standard Input/Output Library Functions 3388.6 String-Manipulation Functions of the String-Handling Library 3438.7 Comparison Functions of the String-Handling Library 3458.8 Search Functions of the String-Handling Library 3478.9 Memory Functions of the String-Handling Library 3548.10 Other Functions of the String-Handling Library 3589 C Formatted Input/Output 3729.1 Introduction 3739.2 Streams 3739.3 Formatting Output with printf 3739.4 Printing Integers 3749.5 Printing Floating-Point Numbers 376xii Contents9.6 Printing Strings and Characters 3779.7 Other Conversion Specifiers 3799.8 Printing with Field Widths and Precision 3809.9 Using Flags in the printf Format Control String 3839.10 Printing Literals and Escape Sequences 3859.11 Reading Formatted Input with scanf 38610 C Structures, Unions, Bit Manipulationsand Enumerations 40110.1 Introduction 40210.2 Structure Definitions 40210.3 Initializing Structures 40510.4 Accessing Members of Structures 40510.5 Using Structures with Functions 40710.6 typedef 40710.7 Example: High-Performance Card Shuffling and Dealing Simulation 40810.8 Unions 41110.9 Bitwise Operators 41310.10 Bit Fields 42210.11 Enumeration Constants 42611 C File Processing 43811.1 Introduction 43911.2 Data Hierarchy 43911.3 Files and Streams 44111.4 Creating a Sequential-Access File 44211.5 Reading Data from a Sequential-Access File 44711.6 Random-Access Files 45211.7 Creating a Random-Access File 45311.8 Writing Data Randomly to a Random-Access File 45511.9 Reading Data from a Random-Access File 45811.10 Case Study: Transaction-Processing Program 45912 C Data Structures 47712.1 Introduction 47812.2 Self-Referential Structures 47912.3 Dynamic Memory Allocation 47912.4 Linked Lists 48112.5 Stacks 49012.6 Queues 49612.7 Trees 50213 C Preprocessor 53313.1 Introduction 534Contents xiii13.2 #include Preprocessor Directive 53413.3 #define Preprocessor Directive: Symbolic Constants 53513.4 #define Preprocessor Directive: Macros 53513.5 Conditional Compilation 53713.6 #error and #pragma Preprocessor Directives 53813.7 # and ## Operators 53813.8 Line Numbers 53913.9 Predefined Symbolic Constants 53913.10 Assertions 54014 Other C Topics 54514.1 Introduction 54614.2 Redirecting Input/Output on Linux/UNIX and Windows Systems 54614.3 Variable-Length Argument Lists 54714.4 Using Command-Line Arguments 54914.5 Notes on Compiling Multiple-Source-File Programs 55114.6 Program Termination with exit and atexit 55214.7 volatile Type Qualifier 55414.8 Suffixes for Integer and Floating-Point Constants 55414.9 More on Files 55414.10 Signal Handling 55714.11 Dynamic Memory Allocation: Functions calloc and realloc 55914.12 Unconditional Branching with goto 56015 Game Programming with theAllegro C Library 56615.1 Introduction 56715.2 Installing Allegro 56715.3 A Simple Allegro Program 56815.4 Simple Graphics: Importing Bitmaps and Blitting 56915.5 Animation with Double Buffering 57415.6 Importing and Playing Sounds 58115.7 Keyboard Input 58515.8 Fonts and Displaying Text 59015.9 Implementing the Game of Pong 59615.10 Timers in Allegro 60215.11 The Grabber and Allegro Datafiles 60815.12 Other Allegro Capabilities 61615.13 Allegro Internet and Web Resources 61716 Sorting: A Deeper Look 62416.1 Introduction 62516.2 Big O Notation 625xiv Contents16.3 Selection Sort 62616.4 Insertion Sort 63016.5 Merge Sort 63317 Introduction to C99 64417.1 Introduction 64517.2 Support for C99 64517.3 New C99 Headers 64617.4 // Comments 64717.5 Mixing Declarations and Executable Code 64717.6 Declaring a Variable in a for Statement Header 64917.7 Designated Initializers and Compound Literals 65017.8 Type bool 65317.9 Implicit int in Function Declarations 65517.10 Complex Numbers 65617.11 Variable-Length Arrays 65717.12 Other C99 Features 65917.13 Internet and Web Resources 66118 C++ as a Better C; Introducing ObjectTechnology 66618.1 Introduction 66718.2 C++ 66718.3 A Simple Program: Adding Two Integers 66818.4 C++ Standard Library 67018.5 Header Files 67118.6 Inline Functions 67318.7 References and Reference Parameters 67618.8 Empty Parameter Lists 68018.9 Default Arguments 68118.10 Unary Scope Resolution Operator 68318.11 Function Overloading 68418.12 Function Templates 68718.13 Introduction to Object Technology and the UML 69018.14 Wrap-Up 69419 Introduction to Classes and Objects 70119.1 Introduction 70219.2 Classes, Objects, Member Functions and Data Members 70219.3 Overview of the Chapter Examples 70319.4 Defining a Class with a Member Function 70419.5 Defining a Member Function with a Parameter 70819.6 Data Members, set Functions and get Functions 711Contents xv19.7 Initializing Objects with Constructors 71819.8 Placing a Class in a Separate File for Reusability 72219.9 Separating Interface from Implementation 72619.10 Validating Data with set Functions 73219.11 Wrap-Up 73720 Classes: A Deeper Look, Part 1 74420.1 Introduction 74520.2 Time Class Case Study 74620.3 Class Scope and Accessing Class Members 75120.4 Separating Interface from Implementation 75320.5 Access Functions and Utility Functions 75520.6 Time Class Case Study: Constructors with Default Arguments 75720.7 Destructors 76320.8 When Constructors and Destructors Are Called 76420.9 Time Class Case Study: A Subtle Trap-Returning a Reference toa private Data Member 76720.10 Default Memberwise Assignment 77020.11 Software Reusability 77220.12 Wrap-Up 77321 Classes: A Deeper Look, Part 2 77921.1 Introduction 78021.2 const (Constant) Objects and const Member Functions 78021.3 Composition: Objects as Members of Classes 79021.4 friend Functions and friend Classes 79721.5 Using the this Pointer 80121.6 Dynamic Memory Management with Operatorsnew and delete 80621.7 static Class Members 80821.8 Data Abstraction and Information Hiding 81421.8.1 Example: Array Abstract Data Type 81521.8.2 Example: String Abstract Data Type 81621.8.3 Example: Queue Abstract Data Type 81621.9 Container Classes and Iterators 81721.10 Proxy Classes 81721.11 Wrap-Up 82122 Operator Overloading 82722.1 Introduction 82822.2 Fundamentals of Operator Overloading 82922.3 Restrictions on Operator Overloading 83022.4 Operator Functions as Class Members vs. Global Functions 832xvi Contents22.5 Overloading Stream Insertion and Stream Extraction Operators 83322.6 Overloading Unary Operators 83722.7 Overloading Binary Operators 83722.8 Case Study: Array Class 83822.9 Converting between Types 85022.10 Overloading ++ and -- 85122.11 explicit Constructors 85222.12 Wrap-Up 85623 Object-Oriented Programming: Inheritance 86823.1 Introduction 86923.2 Base Classes and Derived Classes 87023.3 protected Members 87323.4 Relationship between Base Classes and Derived Classes 87323.4.1 Creating and Using a CommissionEmployee Class 87423.4.2 Creating a BasePlusCommissionEmployee Class WithoutUsing Inheritance 87923.4.3 Creating a CommissionEmployee-BasePlusCommissionEmployeeInheritance Hierarchy 88523.4.4 CommissionEmployee-BasePlusCommissionEmployee InheritanceHierarchy Using protected Data 89023.4.5 CommissionEmployee-BasePlusCommissionEmployee InheritanceHierarchy Using private Data 89723.5 Constructors and Destructors in Derived Classes 90523.6 public, protected and private Inheritance 91323.7 Software Engineering with Inheritance 91323.8 Wrap-Up 91524 Object-Oriented Programming: Polymorphism 92124.1 Introduction 92224.2 Polymorphism Examples 92424.3 Relationships Among Objects in an Inheritance Hierarchy 92524.3.1 Invoking Base-Class Functions from Derived-Class Objects 92524.3.2 Aiming Derived-Class Pointers at Base-Class Objects 93324.3.3 Derived-Class Member-Function Calls via Base-Class Pointers 93424.3.4 Virtual Functions 93624.3.5 Summary of the Allowed Assignments Between Base-Classand Derived-Class Objects and Pointers 94224.4 Type Fields and switch Statements 94224.5 Abstract Classes and Pure virtual Functions 94324.6 Case Study: Payroll System Using Polymorphism 94524.6.1 Creating Abstract Base Class Employee 94724.6.2 Creating Concrete Derived Class SalariedEmployee 95024.6.3 Creating Concrete Derived Class HourlyEmployee 952Contents xvii24.6.4 Creating Concrete Derived Class CommissionEmployee 95524.6.5 Creating Indirect Concrete Derived ClassBasePlusCommissionEmployee 95724.6.6 Demonstrating Polymorphic Processing 95924.7 (Optional) Polymorphism, Virtual Functions and DynamicBinding "Under the Hood" 96324.8 Case Study: Payroll System Using Polymorphism and Runtime TypeInformation with Downcasting, dynamic_cast, typeid and type_info 96724.9 Virtual Destructors 97024.10 Wrap-Up 97125 Templates 97625.1 Introduction 97725.2 Function Templates 97825.3 Overloading Function Templates 98125.4 Class Templates 98125.5 Nontype Parameters and Default Types for Class Templates 98825.6 Notes on Templates and Inheritance 98925.7 Notes on Templates and Friends 98925.8 Notes on Templates and static Members 99025.9 Wrap-Up 99126 Stream Input/Output 99626.1 Introduction 99726.2 Streams 99826.2.1 Classic Streams vs. Standard Streams 99926.2.2 iostream Library Header Files 99926.2.3 Stream Input/Output Classes and Objects 99926.3 Stream Output 100226.3.1 Output of char * Variables 100226.3.2 Character Output Using Member Function put 100226.4 Stream Input 100326.4.1 get and getline Member Functions 100426.4.2 istream Member Functions peek, putback and ignore 100726.4.3 Type-Safe I/O 100726.5 Unformatted I/O Using read, write and gcount 100726.6 Introduction to Stream Manipulators 100826.6.1 Integral Stream Base: dec, oct, hex and setbase 100926.6.2 Floating-Point Precision (precision, setprecision) 101026.6.3 Field Width (width, setw) 101126.6.4 User-Defined Output Stream Manipulators 101326.7 Stream Format States and Stream Manipulators 101426.7.1 Trailing Zeros and Decimal Points (showpoint) 101526.7.2 Justification (left, right and internal) 1016xviii Contents26.7.3 Padding (fill, setfill) 101826.7.4 Integral Stream Base (dec, oct, hex, showbase) 101926.7.5 Floating-Point Numbers; Scientific and Fixed Notation(scientific, fixed) 102026.7.6 Uppercase/Lowercase Control (uppercase) 102026.7.7 Specifying Boolean Format (boolalpha) 102226.7.8 Setting and Resetting the Format State via MemberFunction flags 102326.8 Stream Error States 102426.9 Tying an Output Stream to an Input Stream 102726.10 Wrap-Up 102727 Exception Handling 103827.1 Introduction 103927.2 Exception-Handling Overview 104027.3 Example: Handling an Attempt to Divide by Zero 104027.4 When to Use Exception Handling 104727.5 Rethrowing an Exception 104827.6 Exception Specifications 104927.7 Processing Unexpected Exceptions 105027.8 Stack Unwinding 105127.9 Constructors, Destructors and Exception Handling 105227.10 Exceptions and Inheritance 105327.11 Processing new Failures 105327.12 Class auto_ptr and Dynamic Memory Allocation 105727.13 Standard Library Exception Hierarchy 106027.14 Other Error-Handling Techniques 106227.15 Wrap-Up 1062A Internet and Web Resources 1070A.1 Free C/C++ Compilers and Development Tools 1070A.2 C Resource Sites 1071A.3 C99 1071A.4 C Projects, Freeware and Shareware 1073A.5 C Source Code 1073A.6 C Articles and Whitepapers 1073A.7 C Tutorials and Webcasts 1074A.8 GNOME and GLib 1075A.9 SWIG 1076A.10 Objective-C 1076A.11 C Sample Chapters and eBooks 1077A.12 C Wikis 1077A.13 C FAQs 1077A.14 C Newsgroups 1078Contents xixA.15 C Blogs 1078A.16 C Downloads from Download.com 1078A.17 C Game Programming 1078A.18 Allegro Game Programming Resources 1079A.19 Jobs for C Programmers 1081A.20 Deitel C Training 1081B Operator Precedence Charts 1082C ASCII Character Set 1086D Number Systems 1087D.1 Introduction 1088D.2 Abbreviating Binary Numbers as Octal and Hexadecimal Numbers 1091D.3 Converting Octal and Hexadecimal Numbers to Binary Numbers 1092D.4 Converting from Binary, Octal or Hexadecimal to Decimal 1092D.5 Converting from Decimal to Binary, Octal or Hexadecimal 1093D.6 Negative Binary Numbers: Two's Complement Notation 1095E Game Programming: Solving Sudoku 1100Index 1109
List(s) this item appears in: Computer | Computer_2022
Tags from this library: No tags from this library for this title. Log in to add tags.
Star ratings
    Average rating: 0.0 (0 votes)
Holdings
Item type Current library Call number Status Date due Barcode
Books Books UE-Central Library 005.133 D3686 (Browse shelf(Opens below)) Available T1169

On t.p. of previous ed. H.M. Deitel's name appears first.

Eng.

Preface xxi1 Introduction to Computers, the Internet andtheWeb 11.1 Introduction 21.2 What Is a Computer? 41.3 Computer Organization 41.4 Early Operating Systems 51.5 Personal, Distributed and Client/Server Computing 61.6 Machine Languages, Assembly Languages and High-Level Languages 61.7 Fortran, COBOL, Pascal and Ada 81.8 History of C 81.9 C Standard Library 91.10 C++ 101.11 Java 111.12 BASIC, Visual Basic, Visual C++, Visual C# and .NET 111.13 Key Software Trend: Object Technology 121.14 Typical C Program Development Environment 131.15 Hardware Trends 161.16 History of the Internet 161.17 History of the World Wide Web 181.18 Notes About C and This Book 181.19 Web Resources 192 Introduction to C Programming 322.1 Introduction 332.2 A Simple C Program: Printing a Line of Text 332.3 Another Simple C Program: Adding Two Integers 372.4 Memory Concepts 422.5 Arithmetic in C 432.6 Decision Making: Equality and Relational Operators 473 Structured Program Development in C 623.1 Introduction 633.2 Algorithms 63Contentsx Contents3.3 Pseudocode 643.4 Control Structures 643.5 The if Selection Statement 663.6 The if...else Selection Statement 683.7 The while Repetition Statement 713.8 Formulating Algorithms Case Study 1: Counter-Controlled Repetition 723.9 Formulating Algorithms with Top-Down, Stepwise RefinementCase Study 2: Sentinel-Controlled Repetition 753.10 Formulating Algorithms with Top-Down, Stepwise RefinementCase Study 3: Nested Control Structures 813.11 Assignment Operators 853.12 Increment and Decrement Operators 854 C Program Control 1074.1 Introduction 1084.2 Repetition Essentials 1084.3 Counter-Controlled Repetition 1094.4 for Repetition Statement 1114.5 for Statement: Notes and Observations 1134.6 Examples Using the for Statement 1144.7 switch Multiple-Selection Statement 1184.8 do...while Repetition Statement 1244.9 break and continue Statements 1264.10 Logical Operators 1284.11 Confusing Equality (==) and Assignment (=) Operators 1304.12 Structured Programming Summary 1325 C Functions 1515.1 Introduction 1525.2 Program Modules in C 1525.3 Math Library Functions 1535.4 Functions 1555.5 Function Definitions 1565.6 Function Prototypes 1605.7 Function Call Stack and Activation Records 1625.8 Headers 1635.9 Calling Functions: Call-by-Value and Call-by-Reference 1645.10 Random Number Generation 1655.11 Example: A Game of Chance 1705.12 Storage Classes 1745.13 Scope Rules 1765.14 Recursion 1795.15 Example Using Recursion: Fibonacci Series 1835.16 Recursion vs. Iteration 186Contents xi6 C Arrays 2086.1 Introduction 2096.2 Arrays 2096.3 Defining Arrays 2116.4 Array Examples 2116.5 Passing Arrays to Functions 2256.6 Sorting Arrays 2296.7 Case Study: Computing Mean, Median and Mode Using Arrays 2326.8 Searching Arrays 2356.9 Multiple-Subscripted Arrays 2427 C Pointers 2677.1 Introduction 2687.2 Pointer Variable Definitions and Initialization 2687.3 Pointer Operators 2697.4 Passing Arguments to Functions by Reference 2727.5 Using the const Qualifier with Pointers 2767.6 Bubble Sort Using Call-by-Reference 2827.7 sizeof Operator 2857.8 Pointer Expressions and Pointer Arithmetic 2887.9 Relationship between Pointers and Arrays 2907.10 Arrays of Pointers 2957.11 Case Study: Card Shuffling and Dealing Simulation 2957.12 Pointers to Functions 3008 C Characters and Strings 3258.1 Introduction 3268.2 Fundamentals of Strings and Characters 3268.3 Character-Handling Library 3288.4 String-Conversion Functions 3338.5 Standard Input/Output Library Functions 3388.6 String-Manipulation Functions of the String-Handling Library 3438.7 Comparison Functions of the String-Handling Library 3458.8 Search Functions of the String-Handling Library 3478.9 Memory Functions of the String-Handling Library 3548.10 Other Functions of the String-Handling Library 3589 C Formatted Input/Output 3729.1 Introduction 3739.2 Streams 3739.3 Formatting Output with printf 3739.4 Printing Integers 3749.5 Printing Floating-Point Numbers 376xii Contents9.6 Printing Strings and Characters 3779.7 Other Conversion Specifiers 3799.8 Printing with Field Widths and Precision 3809.9 Using Flags in the printf Format Control String 3839.10 Printing Literals and Escape Sequences 3859.11 Reading Formatted Input with scanf 38610 C Structures, Unions, Bit Manipulationsand Enumerations 40110.1 Introduction 40210.2 Structure Definitions 40210.3 Initializing Structures 40510.4 Accessing Members of Structures 40510.5 Using Structures with Functions 40710.6 typedef 40710.7 Example: High-Performance Card Shuffling and Dealing Simulation 40810.8 Unions 41110.9 Bitwise Operators 41310.10 Bit Fields 42210.11 Enumeration Constants 42611 C File Processing 43811.1 Introduction 43911.2 Data Hierarchy 43911.3 Files and Streams 44111.4 Creating a Sequential-Access File 44211.5 Reading Data from a Sequential-Access File 44711.6 Random-Access Files 45211.7 Creating a Random-Access File 45311.8 Writing Data Randomly to a Random-Access File 45511.9 Reading Data from a Random-Access File 45811.10 Case Study: Transaction-Processing Program 45912 C Data Structures 47712.1 Introduction 47812.2 Self-Referential Structures 47912.3 Dynamic Memory Allocation 47912.4 Linked Lists 48112.5 Stacks 49012.6 Queues 49612.7 Trees 50213 C Preprocessor 53313.1 Introduction 534Contents xiii13.2 #include Preprocessor Directive 53413.3 #define Preprocessor Directive: Symbolic Constants 53513.4 #define Preprocessor Directive: Macros 53513.5 Conditional Compilation 53713.6 #error and #pragma Preprocessor Directives 53813.7 # and ## Operators 53813.8 Line Numbers 53913.9 Predefined Symbolic Constants 53913.10 Assertions 54014 Other C Topics 54514.1 Introduction 54614.2 Redirecting Input/Output on Linux/UNIX and Windows Systems 54614.3 Variable-Length Argument Lists 54714.4 Using Command-Line Arguments 54914.5 Notes on Compiling Multiple-Source-File Programs 55114.6 Program Termination with exit and atexit 55214.7 volatile Type Qualifier 55414.8 Suffixes for Integer and Floating-Point Constants 55414.9 More on Files 55414.10 Signal Handling 55714.11 Dynamic Memory Allocation: Functions calloc and realloc 55914.12 Unconditional Branching with goto 56015 Game Programming with theAllegro C Library 56615.1 Introduction 56715.2 Installing Allegro 56715.3 A Simple Allegro Program 56815.4 Simple Graphics: Importing Bitmaps and Blitting 56915.5 Animation with Double Buffering 57415.6 Importing and Playing Sounds 58115.7 Keyboard Input 58515.8 Fonts and Displaying Text 59015.9 Implementing the Game of Pong 59615.10 Timers in Allegro 60215.11 The Grabber and Allegro Datafiles 60815.12 Other Allegro Capabilities 61615.13 Allegro Internet and Web Resources 61716 Sorting: A Deeper Look 62416.1 Introduction 62516.2 Big O Notation 625xiv Contents16.3 Selection Sort 62616.4 Insertion Sort 63016.5 Merge Sort 63317 Introduction to C99 64417.1 Introduction 64517.2 Support for C99 64517.3 New C99 Headers 64617.4 // Comments 64717.5 Mixing Declarations and Executable Code 64717.6 Declaring a Variable in a for Statement Header 64917.7 Designated Initializers and Compound Literals 65017.8 Type bool 65317.9 Implicit int in Function Declarations 65517.10 Complex Numbers 65617.11 Variable-Length Arrays 65717.12 Other C99 Features 65917.13 Internet and Web Resources 66118 C++ as a Better C; Introducing ObjectTechnology 66618.1 Introduction 66718.2 C++ 66718.3 A Simple Program: Adding Two Integers 66818.4 C++ Standard Library 67018.5 Header Files 67118.6 Inline Functions 67318.7 References and Reference Parameters 67618.8 Empty Parameter Lists 68018.9 Default Arguments 68118.10 Unary Scope Resolution Operator 68318.11 Function Overloading 68418.12 Function Templates 68718.13 Introduction to Object Technology and the UML 69018.14 Wrap-Up 69419 Introduction to Classes and Objects 70119.1 Introduction 70219.2 Classes, Objects, Member Functions and Data Members 70219.3 Overview of the Chapter Examples 70319.4 Defining a Class with a Member Function 70419.5 Defining a Member Function with a Parameter 70819.6 Data Members, set Functions and get Functions 711Contents xv19.7 Initializing Objects with Constructors 71819.8 Placing a Class in a Separate File for Reusability 72219.9 Separating Interface from Implementation 72619.10 Validating Data with set Functions 73219.11 Wrap-Up 73720 Classes: A Deeper Look, Part 1 74420.1 Introduction 74520.2 Time Class Case Study 74620.3 Class Scope and Accessing Class Members 75120.4 Separating Interface from Implementation 75320.5 Access Functions and Utility Functions 75520.6 Time Class Case Study: Constructors with Default Arguments 75720.7 Destructors 76320.8 When Constructors and Destructors Are Called 76420.9 Time Class Case Study: A Subtle Trap-Returning a Reference toa private Data Member 76720.10 Default Memberwise Assignment 77020.11 Software Reusability 77220.12 Wrap-Up 77321 Classes: A Deeper Look, Part 2 77921.1 Introduction 78021.2 const (Constant) Objects and const Member Functions 78021.3 Composition: Objects as Members of Classes 79021.4 friend Functions and friend Classes 79721.5 Using the this Pointer 80121.6 Dynamic Memory Management with Operatorsnew and delete 80621.7 static Class Members 80821.8 Data Abstraction and Information Hiding 81421.8.1 Example: Array Abstract Data Type 81521.8.2 Example: String Abstract Data Type 81621.8.3 Example: Queue Abstract Data Type 81621.9 Container Classes and Iterators 81721.10 Proxy Classes 81721.11 Wrap-Up 82122 Operator Overloading 82722.1 Introduction 82822.2 Fundamentals of Operator Overloading 82922.3 Restrictions on Operator Overloading 83022.4 Operator Functions as Class Members vs. Global Functions 832xvi Contents22.5 Overloading Stream Insertion and Stream Extraction Operators 83322.6 Overloading Unary Operators 83722.7 Overloading Binary Operators 83722.8 Case Study: Array Class 83822.9 Converting between Types 85022.10 Overloading ++ and -- 85122.11 explicit Constructors 85222.12 Wrap-Up 85623 Object-Oriented Programming: Inheritance 86823.1 Introduction 86923.2 Base Classes and Derived Classes 87023.3 protected Members 87323.4 Relationship between Base Classes and Derived Classes 87323.4.1 Creating and Using a CommissionEmployee Class 87423.4.2 Creating a BasePlusCommissionEmployee Class WithoutUsing Inheritance 87923.4.3 Creating a CommissionEmployee-BasePlusCommissionEmployeeInheritance Hierarchy 88523.4.4 CommissionEmployee-BasePlusCommissionEmployee InheritanceHierarchy Using protected Data 89023.4.5 CommissionEmployee-BasePlusCommissionEmployee InheritanceHierarchy Using private Data 89723.5 Constructors and Destructors in Derived Classes 90523.6 public, protected and private Inheritance 91323.7 Software Engineering with Inheritance 91323.8 Wrap-Up 91524 Object-Oriented Programming: Polymorphism 92124.1 Introduction 92224.2 Polymorphism Examples 92424.3 Relationships Among Objects in an Inheritance Hierarchy 92524.3.1 Invoking Base-Class Functions from Derived-Class Objects 92524.3.2 Aiming Derived-Class Pointers at Base-Class Objects 93324.3.3 Derived-Class Member-Function Calls via Base-Class Pointers 93424.3.4 Virtual Functions 93624.3.5 Summary of the Allowed Assignments Between Base-Classand Derived-Class Objects and Pointers 94224.4 Type Fields and switch Statements 94224.5 Abstract Classes and Pure virtual Functions 94324.6 Case Study: Payroll System Using Polymorphism 94524.6.1 Creating Abstract Base Class Employee 94724.6.2 Creating Concrete Derived Class SalariedEmployee 95024.6.3 Creating Concrete Derived Class HourlyEmployee 952Contents xvii24.6.4 Creating Concrete Derived Class CommissionEmployee 95524.6.5 Creating Indirect Concrete Derived ClassBasePlusCommissionEmployee 95724.6.6 Demonstrating Polymorphic Processing 95924.7 (Optional) Polymorphism, Virtual Functions and DynamicBinding "Under the Hood" 96324.8 Case Study: Payroll System Using Polymorphism and Runtime TypeInformation with Downcasting, dynamic_cast, typeid and type_info 96724.9 Virtual Destructors 97024.10 Wrap-Up 97125 Templates 97625.1 Introduction 97725.2 Function Templates 97825.3 Overloading Function Templates 98125.4 Class Templates 98125.5 Nontype Parameters and Default Types for Class Templates 98825.6 Notes on Templates and Inheritance 98925.7 Notes on Templates and Friends 98925.8 Notes on Templates and static Members 99025.9 Wrap-Up 99126 Stream Input/Output 99626.1 Introduction 99726.2 Streams 99826.2.1 Classic Streams vs. Standard Streams 99926.2.2 iostream Library Header Files 99926.2.3 Stream Input/Output Classes and Objects 99926.3 Stream Output 100226.3.1 Output of char * Variables 100226.3.2 Character Output Using Member Function put 100226.4 Stream Input 100326.4.1 get and getline Member Functions 100426.4.2 istream Member Functions peek, putback and ignore 100726.4.3 Type-Safe I/O 100726.5 Unformatted I/O Using read, write and gcount 100726.6 Introduction to Stream Manipulators 100826.6.1 Integral Stream Base: dec, oct, hex and setbase 100926.6.2 Floating-Point Precision (precision, setprecision) 101026.6.3 Field Width (width, setw) 101126.6.4 User-Defined Output Stream Manipulators 101326.7 Stream Format States and Stream Manipulators 101426.7.1 Trailing Zeros and Decimal Points (showpoint) 101526.7.2 Justification (left, right and internal) 1016xviii Contents26.7.3 Padding (fill, setfill) 101826.7.4 Integral Stream Base (dec, oct, hex, showbase) 101926.7.5 Floating-Point Numbers; Scientific and Fixed Notation(scientific, fixed) 102026.7.6 Uppercase/Lowercase Control (uppercase) 102026.7.7 Specifying Boolean Format (boolalpha) 102226.7.8 Setting and Resetting the Format State via MemberFunction flags 102326.8 Stream Error States 102426.9 Tying an Output Stream to an Input Stream 102726.10 Wrap-Up 102727 Exception Handling 103827.1 Introduction 103927.2 Exception-Handling Overview 104027.3 Example: Handling an Attempt to Divide by Zero 104027.4 When to Use Exception Handling 104727.5 Rethrowing an Exception 104827.6 Exception Specifications 104927.7 Processing Unexpected Exceptions 105027.8 Stack Unwinding 105127.9 Constructors, Destructors and Exception Handling 105227.10 Exceptions and Inheritance 105327.11 Processing new Failures 105327.12 Class auto_ptr and Dynamic Memory Allocation 105727.13 Standard Library Exception Hierarchy 106027.14 Other Error-Handling Techniques 106227.15 Wrap-Up 1062A Internet and Web Resources 1070A.1 Free C/C++ Compilers and Development Tools 1070A.2 C Resource Sites 1071A.3 C99 1071A.4 C Projects, Freeware and Shareware 1073A.5 C Source Code 1073A.6 C Articles and Whitepapers 1073A.7 C Tutorials and Webcasts 1074A.8 GNOME and GLib 1075A.9 SWIG 1076A.10 Objective-C 1076A.11 C Sample Chapters and eBooks 1077A.12 C Wikis 1077A.13 C FAQs 1077A.14 C Newsgroups 1078Contents xixA.15 C Blogs 1078A.16 C Downloads from Download.com 1078A.17 C Game Programming 1078A.18 Allegro Game Programming Resources 1079A.19 Jobs for C Programmers 1081A.20 Deitel C Training 1081B Operator Precedence Charts 1082C ASCII Character Set 1086D Number Systems 1087D.1 Introduction 1088D.2 Abbreviating Binary Numbers as Octal and Hexadecimal Numbers 1091D.3 Converting Octal and Hexadecimal Numbers to Binary Numbers 1092D.4 Converting from Binary, Octal or Hexadecimal to Decimal 1092D.5 Converting from Decimal to Binary, Octal or Hexadecimal 1093D.6 Negative Binary Numbers: Two's Complement Notation 1095E Game Programming: Solving Sudoku 1100Index 1109

There are no comments on this title.

to post a comment.
Copyright © 2023, University of Education, Lahore. All Rights Reserved.
Email:centrallibrary@ue.edu.pk