Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> C++

C++ STL में unordered_multimap size() फ़ंक्शन


C++ STL में unordered_multimap size() फ़ंक्शन अनऑर्डर्ड मैप में एलिमेंट्स की संख्या लौटाता है।

एल्गोरिथम

Begin    Declare an empty map container m.    Performing reserve function to restrict the most appropriate    bucket_count of the map container.    Insert values in the map container.    Print the size of the unorderd multimap container by using the size() function. End

उदाहरण कोड

#include<iostream> #include <bits/stdc++.h> using namespace std; int main() {    unordered_map<char, int> m; // m को खाली मैप कंटेनर के रूप में घोषित करना    m.reserve(6); //मैप कंटेनर के सबसे उपयुक्त bucket_count को प्रतिबंधित करना    m.insert (pair<char, int>('b', 10)); // कुछ मान डालना    m.insert (pair<char, int>('a', 20));    cout << "The size is: " << m.size(); //size() फ़ंक्शन द्वारा अनऑर्डर्ड मल्टीमैप कंटेनर का आकार प्रिंट करना।    return 0; }

आउटपुट

The size is :2

  1. - C++ STL में atanh() फ़ंक्शन

    atanh() फ़ंक्शन atanh() फ़ंक्शन आर्क हाइपरबोलिक टैंजेंट (व्युत्क्रम हाइपरबोलिक टैंजेंट) लौटाता है। <cmath> हेडर में परिभाषित (C++11 से)। सिंटैक्स atanh(var) पैरामीटर: var - float, double, या long double। मान -1 और 1 के बीच होना चाहिए (अनन्य)। वापसी मान आर्क हाइपरबोलिक टैंजेंट मान (रेडियन मे

  1. - C++ STL में cosh() फ़ंक्शन

    cosh() फ़ंक्शन cosh() फ़ंक्शन दिए गए कोण (रेडियन में) का हाइपरबोलिक कोसाइन लौटाता है। <cmath> हेडर में परिभाषित। सिंटैक्स cosh(var) पैरामीटर: var - float, double, या long double। वापसी मान हाइपरबोलिक कोसाइन मान, सीमा: [1, ∞)। उदाहरण 1: रेडियन इनपुट #include <iostream> #include <cm

  1. - C++ STL में sinh() फ़ंक्शन

    sinh() फ़ंक्शन sinh() फ़ंक्शन दिए गए कोण (रेडियन में) का हाइपरबोलिक साइन लौटाता है। <cmath> हेडर में परिभाषित। सिंटैक्स sinh(var) पैरामीटर: var - float, double, या long double। वापसी मान हाइपरबोलिक साइन मान, सीमा: (-∞, ∞)। उदाहरण 1: रेडियन इनपुट #include <iostream> #include <cmath