Namespaces
Variants
Views
Actions

cpp/container/vector/size

From cppreference.com
< cpp‎ | container‎ | vector
Revision as of 22:17, 6 May 2015 by Susan7512 (Talk | contribs)

  1. include <vector>
  2. include <iostream>

int main() {

   std::vector<int> nums {1, 3, 5, 7};

   std::cout << "nums contains " << nums.size() << " elements.\n";

}