Book Image

C++ Fundamentals

By : Brent Arnold
Book Image

C++ Fundamentals

By: Brent Arnold

Overview of this book

C++ has come a long way and is now adopted in several contexts. Its key strengths are its software infrastructure and resource-constrained applications, including desktop applications, servers, and performance-critical applications, not to forget its importance in game programming. Despite its strengths in these areas, beginners usually tend to shy away from learning the language because of its steep learning curve. The main mission of this book is to make you familiar and comfortable with C++. You will finish the book not only being able to write your own code, but more importantly, you will be able to read other projects. It is only by being able to read others' code that you will progress from a beginner to an advanced programmer. This book is the first step in that progression.
Table of Contents (6 chapters)
Chapter 5
Standard Library Containers and Algorithms
Content Locked
Section 1
Lesson Overview
The core of C++ is its Standard Template Library (STL), a set of common data structures and algorithms. The components of the STL are parametric, so they can be reused and combined. STL is composed of: - Containers are used to store collections of elements of a certain type. Usually, the type of the container is a template parameter, which allows the same container class to support arbitrary elements. - Iterators are used to traverse the elements of a container. Iterators offer the programmer a simple and common interface to access containers of a different type. - Algorithms are used to perform standard operations on the elements stored in the containers. They use iterators to traverse the collections, since their interface is common to all the containers, so that the algorithm can be agnostic about the container it's operating on.