i've finished a project requiring me to complete a few simple tasks without having any statements in my main besides my function calls and my return 0; statement.

My problem is that in my getArray function, the second to last line is a printf that prints a space. Regardless of what is inside this printf statement, if I attempt to delete it, my program will not run. I get a message from windows saying that myproject.exe has encountered a problem and needs to close. I have no idea what I am doing wrong. Is there someone that can help me? Thank you.

Code:#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define MAX_SIZE 1500 #define BINDATA "E:/231A4bindata.dat" #define EPSILON .01 void getArray (double **data, int *numValues); void sortArray (double **data, int *numValues); void printArray (double **data, double *average, int *numValues); void hiLoEqual (double **data, double *average, int *numValues); void stdDev (double **data, double *average, int *numValues); void getMedian (double **data, int *numValues); void getMode (double **data, int *numValues); int main() { double *data, average; int numValues; getArray(&data, &numValues); sortArray(&data, &numValues); printArray(&data, &average, &numValues); hiLoEqual (&data, &average, &numValues); stdDev (&data, &average, &numValues); getMedian (&data, &numValues); getMode (&data, &numValues); return 0; } /*Function getArray dynamically declares an array of 1500 doubles and fills by reading from a binary file. Array is resized to numValues. */ void getArray (double **data, int *numValues) { FILE * readfile; int ndx = 0, rowCount = 0; int dblsize = sizeof(double); *data = (double *)malloc(MAX_SIZE * dblsize); readfile = fopen (BINDATA, "rb"); *numValues = fread (*data, dblsize, MAX_SIZE, readfile); fclose(readfile); printf (""); *data = (double *) realloc (*data, *numValues); } /* function sortArray sorts double *data in descending order*/ void sortArray (double **data, int *numValues) { int ndx, ndx2, max; double hold, sum = 0; for (ndx = 0; ndx <= *numValues - 2; ndx++) { max = ndx; for (ndx2 = ndx + 1; ndx2 <= *numValues - 1; ndx2++) if ((*data)[ndx2] > (*data)[max]) max = ndx2; hold = (*data)[max]; (*data)[max] = (*data)[ndx]; (*data)[ndx] = hold; } } /*prints array in descending order and prints out highest, lowest, and average value The sum of the data set is calculated in during the sort, and used to caluclate the average afterwards.*/ void printArray (double **data, double *average, int *numValues) { int ndx, rowCount = 0; double sum = 0; printf ("Christian Boman\n"); printf ("Number of values is %d.\n", *numValues); printf ("\nSorted array\n\n"); for (ndx = 0; ndx < *numValues; ndx++){ printf("[%d]\t%6.2f\t", ndx, *(*data + ndx)); rowCount++; if (++rowCount == 5){ printf ("\n"); rowCount = 0; } sum += (*data)[ndx]; } *average = sum / *numValues; printf ("\nHigh is %13.2f\n", (*data)[0]); printf ("Low is %14.2f\n", (*data)[*numValues - 1]); printf ("Average is %10.2f\n", *average); } //Displays how many values are above, below, and equal to the average void hiLoEqual (double **data, double *average, int *numValues) { int ndx, above = 0, below = 0, equal = 0; for (ndx = 0; ndx < *numValues; ndx++) { if ((*data)[ndx] > *average + EPSILON) above++; else if ((*data)[ndx] < *average - EPSILON) below++; else equal++; } printf ("\n= average: %6d\n", equal); printf ("\n> average: %6d\n", above); printf ("\n< average: %6d\n", below); } /* Finds the standard deviation of the data set.*/ void stdDev (double **data, double *average, int *numValues) { int ndx, sizeData = *numValues; double sumSqrs = 0, variance, stdev; double mean = *average; for (ndx = 0; ndx < sizeData; ndx++) sumSqrs += (*data)[ndx] * (*data)[ndx]; variance = (sumSqrs / sizeData - 1) - (mean * mean); stdev = variance * variance; printf ("\nStandard Deviation: %.2f\n", stdev); } //Calculates and displays the median of the data set void getMedian (double **data, int *numValues) { double median; if (*numValues % 2 == 0) median = (*data)[*numValues /2 - 1]; else median = (*data)[*numValues / 2]; printf ("\nMedian :\t%.2f\n", median); } /* Finds and prints the mode of the data set. This algorithm has been optimized for a sorted list*/ void getMode (double **arr, int *numValues) { double mode; int numData = *numValues; int count = 1, modeCount = 0, ndx; for (ndx = 1; ndx < numData; ndx++) { if ((*arr)[ndx] == (*arr)[ndx - 1]) count++; else { if (count > modeCount){ mode = (*arr)[ndx - 1]; modeCount = count; } count = 1; } } printf ("\nThe number %.2f occurs %d time(s)\n", mode, modeCount); }