On second thought, I best just put the code with the corrections to be most clear.
Example:
Code:
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
//Set store tax variables
const float StoreTax1 = 0.0725;
//Declare ProductPrice array
float ProductPrice[]={4.25, 3.00, 1.25, 5.50, 2.50, 7.00, 8.00, 9.00, 8.50, 11.00};
float *Store1TaxPerItem = malloc(sizeof(ProductPrice));
float Store1 = 0.0f; // thank you nonoob
int x = 0;
if(!Store1TaxPerItem)
{
fputs("Uh oh, spighetti-o! Out of memory! Please go purchase more.\n", stderr);
return EXIT_FAILURE;
}
printf("Begin process");
for (x = 0; x < sizeof(ProductPrice)/sizeof(*ProductPrice); x++ )
{
Store1TaxPerItem[x] = ProductPrice[x] * StoreTax1;
printf("The result Store1TaxPerItem %f\n", Store1TaxPerItem[x]);
Store1 = Store1 + Store1TaxPerItem[x];
}
printf("The result is %f\n", Store1);
return EXIT_SUCCESS;
}