I'm guessing that you added those extra spaces so that when you print the names they'll all be the same length. Well, you can achive the same thing with this:Code:char name[][100] = {"Larry Lister", "Sue Sales ", "Eva Escrow ", "Morley Money", "Pete Profit"};
It makes the string at least 10 characters wide, padding it with spaces.Code:printf("%10s\n", str);
I'm guessing you want to calculate the total an average of all of the elements in totsales. In that case, you don't need those local variables, but you do need at least one for loop and the number of elements in totsales (since this is a constant, 6, you don't really have to pass it to the function).Code:void getaverage(double totsales[], double *tot, double *avg )
{
double total, average;
totsales[] += tot;
}
To calculate the total, add up all of the elements in the array. To calculate the average, take the total and divide that by six.
[offtopic] How do you like codeform? [/offtopic]
