// This program allows the user to input a ragged array of integers. // The array consists of 10 rows, but each row can have a different number of values. // The array length[] is used to keep track of how many values per row. #include #include using namespace std; int main() { int *ptr[10]; // a pointer to an array of 10 pointers int length[10]; for (int n=0; n<10; n++) // fill the array { cout << "How many on this row? "; cin >> length[n]; // remember this row's length ptr[n] = new int[length[n]]; // allocate this row for (int k=0; k> ptr[n][k]; // fill this row } } cout << endl; for (int n=0; n<10; n++) // output the array { for (int k=0; k