Quote Originally Posted by master5001 View Post
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;
}
I received this error:

line 7: Parse Error, expecting `','' or `SEP'
'float StoreTax1 = 0.0725'
aborting compile
This occured after I tried to run it. I thought that after each line of code that I finish that I am supposed to end with a semicolon so why is it requesting a comma or seperator?