line 11: Parse Error, expecting `SEP'
'const int TARGET_YEAR = 2010'
Can explain this error to me? I'm copied this code straight from my book and double checked it to make sure.
My program gets your weight, converts it to grams, and tells how old you will be in 2010 (demonstration of constants) Here is my code:
/* Demonstrates variables and constants */
/* Program end variable */
/* Define a constant to convert from pounds to grams */
#define GRAMS_PER_POUND 454
/* Define a constant for the start of the next century */
const int TARGET_YEAR = 2010;
/* Declare the needed variables */
long weight_in_grams, weight_in_pounds;
int year_of_birth, age_in_2010;
/* Input data from user */
printf("Enter your weight in pounds: ");
/* Perform conversions */
weight_in_grams = weight_in_pounds * GRAMS_PER_POUND;
age_in_2010 = TARGET_YEAR - year_of_birth;
/* Display results on the screen */
printf("\nYour weight in grams = %ld", weight_in_grams);
printf("\nIn 2010 you will be %d years old\n", age_in_2010);
/* Hit Enter to end program */
printf ("\nPress [Enter] to continue");
While ((ch = getchar()) != '\n' && ch != EOF);