Herb Schildt’s C++ Programming Cookbook
by: Herb Schildt
Abstract: New from the world’s number-one programming author In this book, bestselling programming author Herb Schildt provides more than 200 practical, self-contained recipes for experienced C++ programmers. Each chapter contains a series of real-life programming tasks, followed by code solutions and concise but detailed discussions on the technique used. This guide will be essential to every C++ programmer’s toolkit.
Full details
Table of Contents
- A. About the Author
- B. Preface
- 1. Overview
- 2. String Handling
- 3. Working with STL Containers
- 4. Algorithms, Function Objects, and Other STL Components
- 5. Working with I/O
- 6. Formatting Data
- 7. Potpourri
Expanded Table of Contents
- A. About the Author
- B. Preface
- 1. Overview
- 2. String Handling
- Overview of Null-Terminated Strings
- Overview of the string Class
- Perform Basic Operations on Null-Terminated Strings
- Search a Null-Terminated String
- Reverse a Null-Terminated String
- Ignore Case Differences When Comparing Null-Terminated Strings
- Create a Search-and-Replace Function for Null-Terminated Strings
- Categorize Characters Within a Null-Terminated String
- Tokenize a Null-Terminated String
- Perform Basic Operations on string Objects
- Search a string Object
- Create a Search-and-Replace Function for string Objects
- Operate on string Objects Through Iterators
- Create Case-Insensitive Search and Search-and-Replace Functions for string Objects
- Convert a string Object into a Null-Terminated String
- Implement Subtraction for string Objects
- 3. Working with STL Containers
- STL Overview
- The Container Classes
- Performance Issues
- Basic Sequence Container Techniques
- Use vector
- Use deque
- Example
- Use list
- Use the Sequence Container Adaptors: stack, queue, and priority_queue
- Store User-Defined Objects in a Container
- Basic Associative Container Techniques
- Use map
- Use multimap
- Use set and multiset
- 4. Algorithms, Function Objects, and Other STL Components
- Algorithm Overview
- Function Object Overview
- Binders and Negators Overview
- Sort a Container
- Find an Element in a Container
- Use search( ) to Find a Matching Sequence
- Reverse, Rotate, and Shuffle a Sequence
- Cycle Through a Container with for_each( )
- Use transform( ) to Change a Sequence
- Perform Set Operations
- Permute a Sequence
- Copy a Sequence from One Container to Another
- Replace and Remove Elements in a Container
- Merge Two Sorted Sequences
- Create and Manage a Heap
- Create an Algorithm
- Use a Built-In Function Object
- Create a Custom Function Object
- Use a Binder
- Use a Negator
- Use the Pointer-to-Function Adaptor
- Use the Stream Iterators
- Use the Insert Iterator Adaptors
- 5. Working with I/O
- I/O Overview
- Checking for Errors
- Opening and Closing a File
- Write Formatted Data to a Text File
- Read Formatted Data from a Text File
- Write Unformatted Binary Data to a File
- Read Unformatted Binary Data from a File
- Use get( ) and getline( ) to Read from a File
- Read from and Write to a File
- Detecting EOF
- Use Exceptions to Detect and Handle I/O Errors
- Use Random-Access File I/O
- Look Ahead in a File
- Use the String Streams
- Create Custom Inserters and Extractors
- Create a Parameterless Manipulator
- Create a Parameterized Manipulator
- Obtain or Set a Stream’s Locale
- Use the C-Based File System
- Rename and Remove a File
- 6. Formatting Data
- Formatting Overview
- The Format Flags
- The Field Width, Precision, and Fill Character
- Format-Related Stream Member Functions
- The I/O Manipulators
- Format Data Using the Localization Library
- The printf( ) Family of Functions
- The strftime( ) Function
- Facet Overview
- Access the Format Flags via Stream Member Functions
- Display Numeric Values in Various Formats
- Set the Precision
- Set the Field Width and Fill Character
- Justify Output
- Use I/O Manipulators to Format Data
- Format Numeric Values for a Locale
- Format Monetary Values Using the money_put Facet
- Use the moneypunct and numpunct Facets
- Format Time and Date Using the time_put Facet
- Format Data into a String
- Format Time and Date Using strftime( )
- Use printf( ) to Format Data
- 7. Potpourri
- Operator Overloading Basic Techniques
- Overload the Function Call Operator ( )
- Overload the Subscripting Operator [ ]
- Overload the −> Operator
- Overload new and delete
- Overload the Increment and Decrement Operators
- Create a Conversion Function
- Create a Copy Constructor
- Determine an Object’s Type at Runtime
- Use Complex Numbers
- Use auto_ptr
- Create an Explicit Constructor
Book Details
Title: Herb Schildt’s C++ Programming Cookbook
Publisher: : New York, Chicago, San Francisco, Lisbon, London, Madrid, Mexico City, Milan, New Delhi, San Juan, Seoul, Singapore, Sydney, Toronto
Copyright / Pub. Date: 2008 The McGraw-Hill Companies
ISBN: 9780071488600
Authors:
Herb Schildt is the author of this McGraw-Hill Professional publication.
Description: New from the world’s number-one programming author In this book, bestselling programming author Herb Schildt provides more than 200 practical, self-contained recipes for experienced C++ programmers. Each chapter contains a series of real-life programming tasks, followed by code solutions and concise but detailed discussions on the technique used. This guide will be essential to every C++ programmer’s toolkit.
