/* * Read some integers into an vector, then echo them. */ #include #include int main() { // Read them in. std::vector vec; std::cout << "Enter some integers: " << std::endl; int val; while(std::cin >> val) { vec.push_back(val); } // Print them back out again. std::cout << "===============" << std::endl; for(int sub = 0; sub < vec.size(); ++sub) std::cout << vec[sub] << " "; std::cout << std::endl; }