C的 __FILE__, __LINE__的意思

C的这些宏有什么意义呢

__LINE__

__FILE__
__DATE__
__TIME__

__STDC__

__FUNCTION__

#include   <iostream>
using   namespace   std;

void   main(void)
{
cout   < <   __FILE__   < <   endl;   //   当前文件路径
cout   < <   __LINE__   < <   endl;   //   当前文件编译行数
cout   < <   __DATE__   < <   endl;   //   编译日期
cout   < <   __TIME__   < <   endl;   //   编译时间

cout   < <   __FUNCTION__   < <   endl;   //   函数名称

}


因此我们可以在debug的时候输入更多有意义的调试信息

如下面的:
NSLog(@"%s:%d, %s",__FILE__, __LINE__, __FUNCTION__);

原文地址:https://www.cnblogs.com/likwo/p/2061527.html