I am new to programming if you could not tell by the advanced code I have laid out for you. I am reading a book on C programming and I copied this code out of it as an exercise and I have no idea why I am getting the error I am. PLEASE HELP!!!
I am getting an error that states "file: main.c" "message: undefined reference to calcyear"
/*bigyear.c*/
#include <stdio.h>
#define TARGET_AGE 88
int year1, year2;
int calcYear(int year1);
int main(void)
{
printf("What year was the subject born?");
printf("Enter as a four digit year (YYYY):");
scanf("%d", &year1);
/*calculate the future year and display it*/
year2 = calcYear(year1);
printf("someone born in %d will be %d in %d.", year1, TARGET_AGE, year2);
return 0;
int calcYear(int year1)
{
return(year1+TARGET_AGE);
}
}