<img src="https://img-blog.youkuaiyun.com/20141104143151751" alt="" />
代码实例:
#include <iostream>
using namespace std;
void show()
{
cout<< "该语句所在的函数名为:"<< __FUNCTION__ <<endl;
cout<< "当前文件名为:" << __FILE__ <<endl;
cout<< "当前代码所在行为:" << __LINE__ <<endl;
}
int main()
{
show();
cout << "编译日期为:"<<__DATE__<<endl;
cout << "编译时间为:"<<__TIME__<<endl;
return 0;
}
运行结果: