#include<iostream.>
using namespace std;
int main()
{
char compile_date[]=__DATE__; //编译源文件的日期
char compile_time[]=__TIME__; //编译源文件的时间
char compile_timestamp[]=__TIMESTAMP__; //最后修改原文件的时间
char compile_file[]=__FILE__; //编译源文件名称
int compile_line=__LINE__; //可用来打印错误代码的行号
char current_function[]=__FUNCTION__; //当前所在函数名
cout<<compile_date<<endl<<compile_time<<endl<<compile_timestamp<<endl<<compile_file<<endl<<compile_line<<endl<<current_function<<endl;
system("Pause");
}
//参考资料:
//http://blog.youkuaiyun.com/clozxy/article/details/5629203
//C++高效编程-内存与性能优化
//http://see.xidian.edu.cn/cpp/html/2552.html
ANSI C标准中有几个标准预定义宏:
最新推荐文章于 2021-03-29 11:13:29 发布