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