#include <stdio.h>
#define DEBUG_PRINT printf("Filename:%s Line: %d \
Compiled Date and Time: %s %s, \
ANSI is %s used\n", __FILE__, __LINE__, \
used__DATE__, __TIME__, __STDC__ == 1 ? "\b" : "not")
//"\b" Backpace to replace the blank before "used"
int main ()
{
DEBUG_PRINT;
return 0;
}预定义符号,__FILE__, __LINE__, __DATE__, __TIME__, __STDC__
本文介绍了一个使用C语言编写的简单程序,该程序能够在运行时打印出文件名、当前行号、编译日期和时间以及是否使用了ANSI C标准的信息。通过宏定义的方式实现了这些调试信息的输出。

被折叠的 条评论
为什么被折叠?



