Linux几个调试宏__FUNCTION__ ,TIME ,LINE ,__FILE__这几个宏是编译器内置的。
__FUNCTION__ :函数名
__TIME__ :文件运行的时间
__LINE__ :所在行数
__FILE__:文件的名字
#include <stdio.h> int main()
{ printf("The file is %s.\n",__FILE__);
printf( "The date is %s.\n", __DATE__ );
printf( "The time is %s.\n", __TIME__
); printf( "This is line %d.\n", __LINE__ );
printf( "This function is %s.\n", __FUNCTION__ );
return 0;
}