A blog about learning C and C++

From C to C++ - the C++ Standard Library

January 29, 2025, by Slobodan Dmitrovic

Both C and C++ have their standard libraries. When moving from C to C++, the existence of C++ Standard Library containers, and functions operating on those containers, is one of the biggest novelties we encounter.

C++ Standard Library - overview

The C++ Standard Library is a collection of ready-made containers, algorithms, and other useful facilities we use in our C++ programs. Every C++ compiler is accompanied by the C++ Standard Library. The C++ Standard Library also encompasses the C standard library. The ported C header files carry the c prefix: <stdio.h> becomes <cstdio>, <math.h> becomes <cmath> etc.

What to learn in the beginning?

Start with these C++ Standard Library topics:

  • Widely used containers (std::array, std::vector, std::list, std::set, std::map…)
  • Iterators
  • Widely used functions (std::sort, std::find, std::find_if, std::count, std::count_if, std::reverse…)

What to learn next?

Explore the following widely-used facilities from the C++ Standard Library:

  • Algorithms defined inside the <algorithm> header file
  • File I/O tools defined inside the <fstream> header file
  • Smart pointers defined inside the <memory> header file
  • Other facilities

Please note that the entire C++ Standard Library is implemented through templates.

Differences between C and C++ - C++ Standard Library

We also have a dedicated training course called "C++ for C Developers." For more info, contact us at contact@cppsrc.com.

Download the Brochure