The key is in
int *compute_sales_total(int yrMo[][months], int years)
{
int *moTot = 0;
for(int i=0; i < months; i++)
{
for(int n=0; n < years; n++)
{
*(moTot + i) += yrMo[n][i];
}
}
return moTot;
}
moTot
is a pointer to int that is initialize (the pointer) as null.
so
moTot+i
points to an arbitrary memory outside your program space, and you're trying to write values in there.
Think a while what the logic of
moTot
should be and redesign.