Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Latest commit

History

History
25 lines (19 loc) 路 714 Bytes

max_size.md

File metadata and controls

25 lines (19 loc) 路 714 Bytes

max_size

Description : The list::max_size() is a built-in function in C++ STL which returns the maximum number of elements a list container can hold.

Example :

    // CPP program to illustrate the 
    // list::max_size() function 
    #include <bits/stdc++.h> 
    using namespace std; 
  
    int main(){ 
        // Creating a list 
        std::list<int> demoList; 
  
        // checking the max size of the list 
        std::cout << demoList.max_size(); 
  
        return 0; 
    } 
    
    //Output is 768614336404564650, it is the number of elements a list container can hold.

See Sample Code Run Code