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