Mega Code Archive

 
Categories / C++ Tutorial / Vector
 

Instantiate a vector with 10 elements, each initialized to 90

#include <vector> int main () {    std::vector <int> v;    // Instantiate a vector with 10 elements (it can grow larger)    std::vector <int> v1 (10);    // Instantiate a vector with 10 elements, each initialized to 90    std::vector <int> vecArrayWithTenInitializedElements (10, 90);    return 0; }