Tag: STL
All the articles with the tag "STL".
-
C++ priority_queue: A Beginner's Guide with Examples
Learn the C++ priority_queue from scratch: push, pop, and top, plus how to build a min-heap and use custom comparators. Beginner-friendly examples included.
-
std::array in C++: A Safer, Modern Alternative to C-Style Arrays
Learn std::array in C++, the size-aware, safer alternative to C-style arrays. How to declare it, loop over it, pass it to functions, and when to use it.
-
C++ Sort Vector of Structs: By Field with std::sort
Learn how to sort a vector of structs in C++ using std::sort with a lambda comparator. Sort by any field, ascending or descending, and by multiple keys.
-
C++ 2D Vector: How to Create and Use a Vector of Vectors
Learn how to create, resize, and iterate over 2D vectors in C++. The flexible alternative to 2D arrays with beginner-friendly examples and common patterns.