The Art of C++
Explaining complex code examples, this book demonstrates the artistry of C++, and includes a chapter, on A C++ Interpreter.
1017953315
The Art of C++
Explaining complex code examples, this book demonstrates the artistry of C++, and includes a chapter, on A C++ Interpreter.
49.0 In Stock
The Art of C++

The Art of C++

The Art of C++

The Art of C++

Paperback

$49.00 
  • SHIP THIS ITEM
    In stock. Ships in 1-2 days.
  • PICK UP IN STORE

    Your local store may have stock of this item.

Related collections and offers


Overview

Explaining complex code examples, this book demonstrates the artistry of C++, and includes a chapter, on A C++ Interpreter.

Product Details

ISBN-13: 9780072255126
Publisher: McGraw-Hill/Osborne Media
Publication date: 04/07/2004
Series: Programming Series
Pages: 401
Product dimensions: 7.28(w) x 9.18(h) x 0.89(d)

Table of Contents

Prefacexv
Chapter 1The Power of C++1
A Terse yet Rich Syntax2
Powerful Libraries3
The STL3
The Programmer Is in Control4
Detailed Control4
Operator Overloading5
A Clean, Streamlined Object Model5
The Legacy of C++6
Chapter 2A Simple Garbage Collector for C++7
Comparing the Two Approaches to Memory Management8
The Pros and Cons of Manual Memory Management9
The Pros and Cons of Garbage Collection10
You Can Have It Both Ways11
Creating a Garbage Collector in C++11
Understanding the Problem11
Choosing a Garbage Collection Algorithm12
Reference Counting12
Mark and Sweep13
Copying13
Which Algorithm?13
Implementing the Garbage Collector14
To Multithread or Not?14
When to Collect Garbage?15
What About auto_ptr?15
A Simple C++ Garbage Collector16
An Overview of the Garbage Collector Classes28
GCPtr In Detail29
GCPtr Data Members30
The findPtrInfo() Function31
The GCIterator typedef31
The GCPtr Constructor31
The GCPtr Destructor33
Collect Garbage with collect()33
The Overloaded Assignment Operators35
The GCPtr Copy Constructor37
The Pointer Operators and Conversion Function38
The begin() and end() Functions40
The shutdown() Function40
Two Utility Functions41
GCInfo41
Iter42
How to Use GCPtr44
Handling Allocation Exceptions46
A More Interesting Example46
Allocating and Discarding Objects49
Allocating Arrays51
Using GCPtr with Class Types53
A Larger Demonstration Program55
Load Testing62
Some Restrictions64
Some Things to Try65
Chapter 3Multithreading in C++67
What Is Multithreading?68
Multithreading Changes the Architecture of a Program69
Why Doesn't C++ Contain Built-In Support for Multithreading?69
What Operating System and Compiler?70
An Overview of the Windows Thread Functions70
Creating and Terminating a Thread71
The Visual C++ Alternatives to CreateThread() and ExitThread()72
Suspending and Resuming a Thread73
Changing the Priority of a Thread74
Obtaining the Handle of the Main Thread75
Synchronization76
Creating a Thread Control Panel79
The Thread Control Panel80
A Closer Look at the Thread Control Panel85
Demonstrating the Control Panel91
A Multithreaded Garbage Collector96
The Additional Member Variables97
The Multithreaded GCPtr Constructor97
The TimeOutExc Exception99
The Multithreaded GCPtr Destructor100
The gc() Function100
The isRunning() Function101
Synchronizing Access to gclist101
Two Other Changes102
The Entire Multithreaded Garbage Collector102
Using the Multithreaded Garbage Collector116
Some Things to Try118
Chapter 4Extending C++119
Why Use a Translator?120
The Experimental Keywords121
The foreach Loop122
The cases Statement123
The typeof Operator124
The repeat/until Loop125
A Translator for Experimental C++ Features125
Using the Translator135
How the Translator Works136
The Global Declarations136
The main() Function137
The gettoken() and skipspaces() Functions139
Translating the foreach Loop142
Translating the cases Statement145
Translating the typeof Operator148
Translating a repeat/until Loop149
A Demonstration Program151
Some Things to Try158
Chapter 5An Internet File Downloader159
The WinINet Library160
The File Downloader Subsystem161
General Theory of Operation166
The download() Function167
The ishttp() Function172
The httpverOK() Function173
The getfname() Function174
The openfile() Function174
The update() Function175
The Download Header File176
Demonstrating the File Downloader177
A GUI-Based Downloader178
The WinDL Code179
How WinDL Works185
Some Things to Try186
Chapter 6Financial Calculations in C++187
Finding the Payments for a Loan188
Finding the Future Value of an Investment190
Finding the Initial Investment Required to Achieve a Future Value192
Finding the Initial Investment Needed for a Desired Annuity194
Finding the Maximum Annuity for a Given Investment196
Finding the Remaining Balance on a Loan197
Some Things to Try199
Chapter 7Al-Based Problem Solving201
Representation and Terminology202
Combinatorial Explosions204
Search Techniques206
Evaluating a Search206
The Problem206
A Graphic Representation207
The FlightInfo Structure and the Search Class207
The Depth-First Search211
The match() Function217
The find() Function217
The findroute() Function218
Displaying the Route219
An Analysis of the Depth-First Search220
The Breadth-First Search220
An Analysis of the Breadth-First Search223
Adding Heuristics224
The Hill-Climbing Search224
An Analysis of Hill Climbing230
The Least-Cost Search231
An Analysis of the Least-Cost Search232
Finding Multiple Solutions233
Path Removal234
Node Removal235
Finding the "Optimal" Solution243
Back to the Lost Keys249
Some Things to Try253
Chapter 8Building a Custom STL Container255
A Brief Review of the STL256
Containers257
Algorithms257
Iterators257
Other STL Entities257
Custom Container Requirements258
General Requirements258
Additional Sequence Container Requirements260
Associative Container Requirements260
Creating a Range-Selectable, Dynamic Array Container261
How RangeArray Works261
The Entire RangeArray Class263
The RangeArray Class in Detail275
Some RangeArray Sample Programs288
Some Things to Try299
Chapter 9A Mini C++ Interpreter301
Interpreters versus Compilers302
An Overview of Mini C++303
The Mini C++ Specifications304
Some Mini C++ Restrictions305
An Informal Theory of C++306
C++ Expressions307
Defining an Expression307
The Expression Parser309
The Parser Code309
Tokenizing the Source Code324
Displaying Syntax Errors330
Evaluating an Expression331
The Mini C++ Interpreter333
The main() Function354
The Interpreter Prescan356
The interp() Function359
Handling Local Variables362
Calling User-Defined Functions364
Assigning Values to Variables366
Executing an if Statement368
The switch and break Statements370
Processing a while Loop372
Processing a do-while Loop373
The for Loop375
Handling cin and cout Statements377
The Mini C++ Library Functions379
The mccommon.h Header File381
Compiling and Linking the Mini C++ Interpreter383
Demonstrating Mini C++383
Improving Mini C++393
Expanding Mini C++393
Adding New C++ Features394
Adding Ancillary Features394
Index395
From the B&N Reads Blog

Customer Reviews