/* * Read some integers into an array, then echo them. */ #include using namespace std; // It's usual to give a name to array sizes. const int ARRMAX = 100; int main() { // This creates a native array. int arr[ARRMAX]; int sub = 0; cout << "Enter some integers: " << endl; while(cin >> arr[sub]) { ++sub; } int num = sub; /* Print them back out again. */ cout << "===============" << endl; for(int sub = 0; sub < num; ++sub) { cout << arr[sub] << " "; } cout << endl; }