69,368
社区成员
发帖
与我相关
我的任务
分享
/* a.c */
#ifdef INT
typedef int DataType
#endif
#ifdef FLOAT
typedef float DataType
#endif
DataType max(DataType x, DataType)
{
return x > y ? x: y;
}
/* b.c */
#include <stdio.h>
#include "a.c"
int
main()
{
#define INT
printf("max = %d\n", max(4, 3));
#undef INT
#define FLOAT
printf("max = %f\n", max(3.14, 3.15));
#undef FLOAT
return 0;
}