C++ examples for STL:vector
Resizing a vector
#include <cinttypes> #include <iostream> #include <vector> using namespace std; int main(int argc, char* argv[]) { vector<int32_t> stlVector{ 10, 65, 3000, 2, 49 }; cout << "The size is: " << stlVector.size() << endl; stlVector.emplace_back( 50 );/*from w w w . ja v a 2 s . c o m*/ cout << "The size is: " << stlVector.size() << endl; for (auto&& number : stlVector) { std::cout << number << endl; } return 0; }