Error: no matching function for call to memsetNincr. Please help.
#include <iostream>
using namespace std;
void memsetNincr(int, int, int);
int main()
{
int size, initVal;
cout << "Enter size of array followed by the value of its' first element: \n";
cin >> size >> initVal;
int array[size];
cout << memsetNincr(array, size, initVal) << endl;
return 0;
}
void memsetNincr(int array[], int howmany, int startingVal)
{
int i;
array[0] = startingVal;
for (i=0; i<=howmany; i++)
{
array[i] = array[i-1]-1;
cout << array[i] << " ";
}
}
The prototype
void memsetNincr(int, int, int);
doesn't match the definition
void memsetNincr(int array[], int howmany, int startingVal)
of the function. Change the prototype.