What is the size of the array? The program crashing could be it exceeding the bounds of the array.
this is my main:
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstdlib>
#include <string>
using namespace std;
const int NUM_MONTHS = 12;
const string MONTH_NAMES[NUM_MONTHS+1] = { "", "January", "February", "March",
"April", "May", "June", "July", "August", "September",
"October", "November", "December" };
void buildSalesArray(double salesArray[]);
void printSalesArray(double salesArray[]);
double findSum(double salesArray[]);
double findMean(double salesArray[]);
int findHighMonth(double salesArray[]);
int findLowMonth(double salesArray[]);
int main()
{
double salesArray[NUM_MONTHS+1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
buildSalesArray(salesArray);
printSalesArray(salesArray);
findSum(salesArray);
findMean(salesArray);
findHighMonth(salesArray);
findLowMonth(salesArray);
return 0;
}