This doesn’t work. Can anyone tell why?
#include <iostream>
using namespace std;
int mean( int );
int main() {
int array[] = {43, 5, 3, 5, 2};
cout << mean(array);
}
int mean( int list[] ) {
return list[0];
}
These are the errors I’m getting:
Invalid conversion from 'int*' to 'int'
Initializing argument 1 of 'int mean(int)'
You are forward declaring the
meanfunction using a different signature. Fix your forward declaration: