#include #include using namespace std; int main(){ cout << endl<< "*** This program tests some of the default declarations of vector containers, for the built in types and the string type ****" << endl<< endl; cout << "Declaration using the constructor which initialises a vector of integers with 3 copies of value 1" << endl; vector v1(3,1); for(vector::size_type i=0; i!=v1.size();i++){ cout << v1[i]<< "\t"; } cout<< endl; cout << "Now the value of an element is changed..."<< endl; v1[1]=400; for(vector::size_type i=0; i!=v1.size();i++){ cout << v1[i]<< "\t"; } cout<< endl; cout << "Declaration using the constructor which initialises the size of the vector of integers and gives each component the default initial value" << endl; vector v2(4); for(vector::size_type i=0; i!=v2.size();i++){ cout << v2[i]<< "\t"; } cout<< endl; cout << "Same as previous example but we initialise a vector of bool variables and check what the default initial values is (false as you can check)" << endl; vector FalseOrTrue(10); for(vector::size_type i=0; i!=FalseOrTrue.size();i++){ cout << FalseOrTrue[i]<< "\t"; } cout<< endl; }