int main (void) { int calcYear(int year1); { return (year1 + TARGET_AGE); } } 和 /*include.c*/ #include <stdio.h> #include <test.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 4-digit year (YYYY):"); scanf(" %d ", &year1);
year2 = calcYear(year1);
printf("Someone born in %d will be %d in %d.", year1, TARGET_AGE, year2); return 0; } 如果我把 test.c 加入到 C 编译器的库函数里后(这个不知道行不,或者自己创建函数库?),再编辑 include.c 并编译,这样可以成功执行吗?