

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
multiset size() in C++ STL with Examples
In this tutorial, we will be discussing a program to understand multiset size() in C++ STL.
The function size() returns the number of elements present into a given container.
Example
#include <bits/stdc++.h> using namespace std; int main(){ multiset<int> s; s.insert(10); s.insert(13); cout << "The size of multiset: " << s.size(); s.insert(13); s.insert(25); cout << "\nThe size of multiset: " << s.size(); s.insert(24); cout << "\nThe size of multiset: " << s.size(); return 0; }
Output
The size of multiset: 2 The size of multiset: 4 The size of multiset: 5
- Related Questions & Answers
- multiset max_size() in C++ STL with Examples
- multiset upper_bound() in C++ STL with Examples
- multiset lower_bound() in C++ STL with Examples
- multiset insert() function in C++ STL
- multiset clear() function in C++ STL
- multiset count() function in C++ STL
- multiset empty() function in C++ STL
- Multiset emplace_hint() function in C++ STL
- multiset equal_range() function in C++ STL
- C++ Program to Implement Multiset in STL
- Multiset in C++ Standard Template Library (STL)
- Array data() in C++ STL with Examples
- forward_list max_size() in C++ STL with Examples
- multiset begin() and end() function in C++ STL
- multiset cbegin() and cend() function in C++ STL
Advertisements