#include #include #include #include "obj.h" using namespace std; int main() { vector v1; //born empty vector v2(3); cout << "\n"; vector v3(3, 10); cout << "\n"; vector v4(3, obj(20)); cout << "\n"; const int a[] = { 30, 40, 50 }; const size_t na = sizeof a / sizeof a[0]; vector v5(a, a + na); cout << "\n"; const obj b[] = { obj(60), obj(70), obj(80) }; cout << "\n"; const size_t nb = sizeof b / sizeof b[0]; vector v6(b, b + nb); cout << "\n"; for (vector::const_iterator it = v6.begin(); it != v6.end(); ++it) { cout << *it << "\n"; //can also say (*it).print() or it->print() } cout << "\n"; return EXIT_SUCCESS; }