多用于告警提示:
__FILE__ 包含当前程序文件名的字符串
__LINE__ 表示当前行号的整数
__DATE__ 包含当前日期的字符串
__STDC__ 如果编译器遵循ANSI C标准,它就是个非零值
__TIME__ 包含当前时间的字符串
代码示例如下:
#include <stdio.h>
int main()
{
printf("file name is %s\n", __FILE__); //文件名
printf("line is %d\n", __LINE__); //行号
printf("date is %s\n", __DATE__); //日期
printf("time is %d\n", __TIME__); //时间
return 0;
}
![](https://img-my.csdn.net/uploads/201207/19/1342666531_6483.png)