O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

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

STL Containers

The STL containers are holder objects that hold other objects of a given type. Because they are template classes, they can hold any type and type selection is performed at compile time. An example of a container is an integer array; this is actually a built-in type in C but defined as a class in C++.

The data contained within the container class is a collection of elements. As in an array, where you refer to each item as an element, you also refer to each item in a container as an element and the class allows you to access them through specific interface methods.

Some examples of containers that are provided in the STL are as follows:

  • Dynamic arrays

  • Queues

  • Stacks

  • Linked lists

These have been given specific template class names in ...

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