Unknown msg after compiling

I am a fairly new programer and writing a simple program that reads in some sales information from a txt file. I am trying to call my buildSalesArray function but i get a msg i have not ever seen after compiling. Can anyone explain what this means

Undefined symbols:
"buildSalesArray(double)", referenced from:
_main in ccfPTJJN.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


Here is what i have so far

#include <iostream>
#include <fstream>

using namespace std;

const int NUM_MONTHS = 12;
const string MONTH_NAMES[NUM_MONTHS+1] = { "", "January", "Febuary", "March",
"April", "May", "June", "August", "September", "October", "November",
"December" };

void buildSalesArray(double);

int main()
{
double salesArray[NUM_MONTHS+1] = { 0 };

buildSalesArray(salesArray[NUM_MONTHS+1]);

return 0;
}
void buildSalesArray(double salesArray[])
{
ifstream infile;
int monthNumber;
double sales;

infile.open("sales.txt");

if (infile.fail())
{
cout << "Unable to open sales.txt file\n";
exit(1);
}

infile >> monthNumber;
while (!infile.eof())
{
infile >> sales;
salesArray[monthNumber] = salesArray[monthNumber] + sales;

infile >> monthNumber;
}

infile.close();
}

1
2
3
4
5
6
7
8
9
10
11
void buildSalesArray(double); // PARAMETER TYPE MISMATCH between this prototype

int main()
{
double salesArray[NUM_MONTHS+1] = { 0 };

buildSalesArray(salesArray[NUM_MONTHS+1]);

return 0;
}
void buildSalesArray(double salesArray[]) //AND this line here 
Thanks, that worked.
Topic archived. No new replies allowed.