please help fast with "[Error] invalid conversion from 'int*' to 'int' [-fpermissive] "

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);




int main()
{

cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);

int entry=0;
int array[list_size];

getIn(array,entry);
swapFrontBack(array,entry);
report(array,entry);



return 0;
}





thank you
Last edited on
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.
given the english names I would think you want to define report as

report(int count, int* list);

but that implies that the other functions that use "list" are also wrong (?).

thank you guys for your help
Topic archived. No new replies allowed.