I’m confused I wrote a program for an assignment that is almost identical to this one (it worked fin) so I copied 85% to this one. But in this one I get an error I didn’t get before.
The error is: [Error] invalid conversion from 'int*' to 'int' [-fpermissive]. It refers ti this line: report(array,entry);
here is the main section of the code:
#include <iostream>
using namespace std;
void swapFrontBack(int array[],int list);
void getIn(int array[], int &list);
int countNum2s(int array[],int list);
const int list_size=1000;
void report (int count, int list);
My compiler shows:
c++ -O2 -pipe x.cc -o x
x.cc:21:3: error: no matching function for call to 'report'
report(array,entry);
^~~~~~
x.cc:8:6: note: candidate function not viable: no known conversion from 'int [1000]' to 'int' for 1st argument
void report (int count, int list);
^
1 error generated.
*** Error code 1
That means, report() takes two int parameters, but you've passed it an array of int and an int.