University of Leeds

C++ Standard Library

Introduction

The C++ Standard Library is a set of classes that comes as a part of the C++ language. These classes include things such as strings and arrays as well as common mathematical functions. They can be used in programs through including the relevant header file e.g. string and are usually declared within the std namespace.

You have already come across several of these classes in previous laboratory sessions and in this session, we will look at some others that can be useful.

You will also be expected to start looking online for resources in order to help you learn how to use these classes. You are not expected know the entire C++ language off the top of your head (I certainly do not!). I doubt many people in the whole world know how to use every single feature of the language. A big part of being a programmer is having the ability to search online in order to find APIs (application programming interfaces) and example code and being able to adapt them to your own needs.

A good starting point is usually cplusplus.com. It contains a list of all C++ library, along with a full API and example code.