এই টিউটোরিয়ালে, আমরা সি++ STL-এ মাল্টিসেট size() ফাংশন সম্পর্কে আলোচনা করব।
size() ফাংশনটি একটি কন্টেইনারে উপস্থিত এলিমেন্টের সংখ্যা রিটার্ন করে।
উদাহরণ
#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