- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Containers in C++ STL
In this tutorial, we will be discussing a program to understand containers in C++ STL.
Containers are the objects used to store multiple elements of the same type or different. Depending on that they can be further classified as −
Sequence containers (array, vector, list)
Associative containers (set, map, multimap)
Unordered Associative containers (unordered_set, unordered_map)
Container Adapters (stack, queue)
Example
#include <iostream> using namespace std; int main(){ int array[10] = {1,2,3,4}; for(int i=0; i<10; i++){ cout << array[i] << " "; } return 0; }
Output
1 2 3 4 0 0 0 0 0 0
- Related Articles
- C++ Program to Implement Sorting containers in STL
- Swapping of subranges from different containers in C++
- Pickles are kept in plastic containers because plastic containers arenon-corrosivelightcolourfulcheap
- Library in C++ STL?
- stable_sort() in C++ STL
- count_if() in C++ STL
- Maximizing Probability of one type from N containers in C++
- deque_resize( ) in C++ in STL
- deque_rbegin( ) in C++ in STL
- deque_rend( ) in C++ in STL
- deque_insert( ) in C++ in STL
- deque_emplace in C++ in STL
- deque_crend in C++ in STL
- deque_max_size( ) in C++ in STL
- sinh() function in C++ STL

Advertisements