Herb Schildt's C++ Programming Cookbook

Front Cover
McGraw Hill Professional, May 22, 2008 - Computers - 528 pages

Your Ultimate "How-To" Guide to C++ Programming!

Legendary programming author Herb Schildt shares some of his favorite programming techniques in this high-powered C++ "cookbook." Organized for quick reference, each "recipe" shows how to accomplish a practical programming task. A recipe begins with a list of key ingredients (classes, functions, and headers) followed by step-by-step instructions that show how to assemble them into a complete solution. Detailed discussions explain the how and why behind each step, and a full code example puts the recipe into action. Each recipe ends with a list of options and alternatives that suggest ways to adapt the technique to fit a variety of situations. Whether you're a beginner or an experienced pro, you'll find recipes that are sure to satisfy your C++ programming appetite!

Topics include:

String Handling Standard Template Library (STL) Containers Algorithms Function Objects Binders Negators Adaptors Iterators I/O Formatting Data

Learn how to:

  • Tokenize a null-terminated string
  • Create a search and replace function for strings
  • Implement subtraction for string objects
  • Use the vector, deque, and list sequence containers
  • Use the container adaptors stack, queue, and priority_queue
  • Use the map, multimap, set, and multiset associative containers
  • Reverse, rotate, and shuffle a sequence
  • Create a function object
  • Use binders, negators, and iterator adapters
  • Read and write files
  • Use stream iterators to handle file I/O
  • Use exceptions to handle I/O errors
  • Create custom inserters and extractors
  • Format date, time, and numeric data
  • Use facets and the localization library
  • Overload the [ ], ( ), and -> operators
  • Create an explicit constructor
  • And much, much more

What people are saying - Write a review

User Review - Flag as inappropriate

This book gives more help on C++ than Stroustrup does. Explained well and definite. A must buy. Finally!

User Review - Flag as inappropriate

This book is highly overrated. It contains only a couple recipes that an experienced programmer would not immediately comprehend.


1 Overview
2 String Handling
3 Working with STL Containers
4 Algorithms Function Objects and Other STL Components
5 Working with IO
6 Formatting Data
7 Potpourri

Other editions - View all

Common terms and phrases

Popular passages

Page 288 - Thus, there are limits to the number of files that can be open at any one time.
Page 14 - Equal to ! = Not equal to < Less than <- Less than or equal to > Greater than >- Greater than or equal to...
Page 1 - I had to decide what to include and what not to include. In general, I included a recipe if it met the following two criteria.
Page xvi - ... nearly unbounded number of possible recipes), I tried to span a wide range of topics. My criteria for including a recipe are discussed in detail in Chapter 1, but briefly, I included recipes that would be useful to many programmers and that answered frequently asked questions. Even with these criteria, it was difficult to decide what to include and what to leave out. This was the most challenging part of writing this book. Ultimately, it came down to experience, judgment, and intuition. Hopefully,...
Page 419 - Since the hexadecimal number system uses the letters A through F to represent the numbers 10 through 15, you can display these letters in either upper- or lowercase.
Page 382 - SETPREC.CPP, uses the setprecision manipulator to change the number of digits displayed to the right of the decimal point...
Page 185 - Returns a range in which an element can be inserted into a sequence without disrupting the ordering of the sequence.
Page 342 - That is, the values of the member variables x, y, and z are returned. thisPointerClass: : thisPointerClass (int a, int b, int c) { x = a; y = b; z = c; } Consider the following function main: //Chapter 15: this pointer illustration #include <iostream> #include "thisPointerIllus .h...

About the author (2008)

Herb Schildt is a leading authority on C, C++, Java, and C#, and is a master Windows programmer. His programming books have sold more than 3.5 million copies worldwide and have been translated into all major foreign languages. Herb is the author of numerous bestsellers, including C++: The Complete Reference, Java: The Complete Reference, C#: The Complete Reference, and C++: A Beginner's Guide.

Bibliographic information