Sep 17, 2019 at 12:35am
Whenever I try to compile and run the code I get an "expected primary-expression before 'int'" error on lines 9 and 21.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#include <iostream>
using namespace std;
int array[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
void display_array(int array[]);
void fill_array(int array[]);
int main()
{
cout << "Enter integers to fill the array: ";
fill_array(int array[]);
system("pause");
return 0;
}
void fill_array(int array[])
{
array[10];
for(int i = 0; i < 10; i++)
cin >> array[i];
cout << endl;
display_array(int array[10]);
}
void display_array(int array[])
{
array[10];
for(int i = 0; i < 10; i++)
cout << array[i] << " ";
cout << endl;
}
|
Last edited on Sep 17, 2019 at 12:36am