- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- 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
Advertisements
To Continue Learning Please Login
Login with Google