O'Reilly logo

C++ All-In-One For Dummies®, 2nd Edition by Jeff Cogswell, John Paul Mueller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Programming with the Standard Library

In This Chapter

  • Architecting the Standard C++ Library

  • Storing data in vector or map

  • Containing data with a list or set

  • Stacking and queuing

  • Copying containers

When you get around in the world of C++ programming (a fun world indeed!), you're going to encounter two different libraries that people use to make their lives easier. That is, after all, the ultimate point of computers — to make our lives easier, right? These two libraries are

  • Standard C++ Library

  • Standard Template Library (STL)

Some people say, "We use STL." Others say, "We use the Standard C++ Library." In this case, library means a set of classes that you can use in your programs. These libraries include handy classes, such as string and vector (which is like an array in that it's a list in which you can store objects).

The difference between the Standard C++ Library and STL is that STL came first. STL was used by so many developers that the American National Standards Institute (ANSI) decided to standardize it. The result is the similar Standard C++ Library that is part of the official ANSI standard and now part of most modern C++ compilers (including CodeBlocks, Microsoft Visual C++, Borland C++ Builder, MinGW, Cygwin, and Dev-C++). We use the Standard C++ Library in this chapter. Because we know that this is C++, we just call it the Standard Library.

The concepts that we present here apply to STL, so if you're using STL, you can use this chapter.

Architecting the Standard Library ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required