关于 C++预处理命令(2)

// 标准宏名称
#include <iostream>
using namespace std;

int main()
{
cout << "This is the line number "
<< __LINE__;
cout << " of file " << __FILE__
<< ".\n";
cout << "Its compilation began "
<< __DATE__;
cout << " at " << __TIME__ << ".\n";
cout << "The compiler gives a "
<<"__cplusplus value of "
<< __cplusplus;
return 0;
}

输出结果:

This is the line number 7 of file /home/jay/stdmacronames.cpp.
Its compilation began Nov 1 2005 at 10:12:29.
The compiler gives a __cplusplus value of 1

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/d1f693c5ace9098d83d54c0fe39eebae.html