Ok thanks for clearing that up. When I do that my compiler tells me I need a ; before the ) in my for statement. Sidenote, when I add the ; I get the result of zero displayed for my program.
Here is my update code:
Code:
void extend (double [], double [], double []); /*function prototype*/
int main()
{
#define MAXELS 10
double price[MAXELS]= {10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, 3.98};
double quantity[MAXELS]= {4, 8.5, 6, 8.35, 9, 15.3, 3, 5.4, 2.9, 4.8};
double amount[MAXELS];
printf("The amounts of each element are %lf\n", &amount[MAXELS]);
system("pause");
return 0;
}
void extend (double price[MAXELS], double quantity[MAXELS], double amount[MAXELS])
{
int i;
for (i = 0, i < MAXELS; i++)
{
amount[i]=price[i]*quantity[i];
}
}