How to get length of vector in C++

1 Answer

0 votes
#include <iostream>
#include <vector>

int main() {
    std::vector<int> v { 1, 4, 8, 7, 0, 3 };

    std::cout << v.size();

    return 0;
}
    
    
    
    
/*
run:
  
6
     
*/

 



answered May 11, 2021 by avibootz
...