// PL3/vector.cpp // Demonstration of the vector container // Niels Walet, last updated 04/12/2019 #include #include #include //using namespace std; //could have used that here to help readability int main() { const size_t n_a{5}; std::vector a(n_a); //length 5 vector of type double std::vector b; // empty vector (stores doubles) std::vector c(3,1); //length 3 vector of integers, with all elements 1 std::vector names(3); //vector with 3 strings std::vector > dd(3); //vector containing 3 empty double vectors dd[0]=a;// set the first element of dd to the vector a }