When trying to move the arrays average and total from double calc to int main they both lose whatever data is stored in them and I am unable to figure out why. Any help is appreciated.
> return &mpd and &name;
> return &average and &total;
it doesn't work that way.
When you write
1 2 3 4 5
double //return type
calc //function name
( //parameters
double mpd[5][7]
);
you are saying that your functions return a double, just one number.
You are also confused by scope. `average' and `total' in `calc()' are not the same variables that `average' and `total' in `main()'.
What you may do is pass the arrays to the function, as you are doing with `mpd' and `name'
1 2 3 4 5 6
void //there is no need to return anything
calc(
double mpd[5][7],
double total[5],
double average[5]
);