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

Latest commit

 

History

History
21 lines (16 loc) · 570 Bytes

size.md

File metadata and controls

21 lines (16 loc) · 570 Bytes

size

Description : The list::vector() is a built-in function in C++ STL which is used to find the number of elements present in a vector container.

Example:

    // Creating a vector
    std::vector<int> example;

    // Adding elements to the vector
    example.push_back(10); 
    example.push_back(20); 
    example.push_back(30); 
    example.push_back(40); 
  
    // getting size of the list 
    int size = example.size(); 
  
    std::cout << "The vector contains " << size << " elements"; 

Run Code