इस ट्यूटोरियल में, हम C++ STL में मल्टीसेट साइज () को समझने के लिए एक प्रोग्राम पर चर्चा करेंगे।
फ़ंक्शन आकार () किसी दिए गए कंटेनर में मौजूद तत्वों की संख्या देता है।
उदाहरण
#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;
} आउटपुट
The size of multiset: 2 The size of multiset: 4 The size of multiset: 5