Check out example codes for "vector length c++". It will help you in understanding the concepts better.

Code Example 1

#include <vector>

int main() {
  std::vector<int> myVector = { 666, 1337, 420 };
  
  size_t size = myVector.size(); // 3
  
  myVector.push_back(399); // Add 399 to the end of the vector
  
  size = myVector.size(); // 4
}

Code Example 2

#include <vector>

int main () {
    std::vector<int> v;
    auto size = v.size();
}

Learn ReactJs, React Native from akashmittal.com