how can i store 30 prices on this void get prices and save it to the array please it goes row by row with prices . void getPrices(double array[], int rows) { for (int i = 0; i < rows; i++) { cout << \"Please enter the price for the seats in row \" << i + 1 << \": $\"; cin >> array[i]; while (array[i] < 0) { cout << \"Please, enter a valid seat price: $\"; cin >> array[i]; } } } Solution What you have written is absolutely correct. after end of \"FOR loop\" you will get all the 30 prices in a array void getPrices(double array[], int rows) { for (int i = 0; i < rows; i++) { cout << \"Please enter the price for the seats in row \" << i + 1 << \": $\"; cin >> array[i]; while (array[i] < 0) { cout << \"Please, enter a valid seat price: $\"; cin >> array[i]; } } } .