预定义符号表
//注: '__' 为两个下划线 '_'
__FILE__ 正在编译的源文件名
__LINE__ 文件当前行的行号
__FUNCTION__ 当前所在的函数名
__DATE__ 预编译文件的日期
__TIME__ 预编译文件的时间
__STDC__ 编译器是否遵循ANSI C,是为1
例:
/*===============================================
* 文件名称:predefined_symbol.c
* 创 建 者:Rem
* 创建日期:2022年12月25日
* 描 述:
================================================*/
#include <stdio.h>
int main()
{
printf("This is to test the predefined symbol table!\n");
printf("file is %s\n", __FILE__);
printf("line is %d\n", __LINE__);
printf("function is %s\n", __FUNCTION__);
printf("date is %s\n", __DATE__);
printf("time is %s\n", __TIME__);
printf("follow ANSI C? -- %d\n", __STDC__);
return 0;
}