C++ static char THIS_FILE[] = __FILE__;
来源:互联网 发布:今日api数据最新 编辑:程序博客网 时间:2024/05/02 03:11
原文地址:http://blog.sina.com.cn/s/blog_69d66cf10100kpcn.html
C++ static char THIS_FILE[] = __FILE__;
__FILE__为预编译器常量,返回当前编译的文件名,还有比较常用的几个预编译器常量,
__LINE__编译器在编译的文件的第几行;
__DATE__返回当前的日期Jul-20-2004;
__TIME__返回当前的时间hh:mm:ss;
__LINE__编译器在编译的文件的第几行;
__DATE__返回当前的日期Jul-20-2004;
__TIME__返回当前的时间hh:mm:ss;
__TIMESTAMP__ 的预定义的编译器宏始终返回时间戳信息在太平洋标准的时间内无论本地时间和CL.EXE 的运行位置在计算机上的时区。
__STDC__条件编译,意思是:如果定义了标准C或c++,那么编译这句话后面直到#endif 以前的源代码。
_STDC__cplusplus这两个都是标准宏,_STDC_表示是是否符合标准C
_cplusplus表示是否是C++
如下为宏定义:
#ifdef _DEBUG //如果定义了_DEBUG
#define new DEBUG_NEW //则定义new为DEBUG_NEW
#undef THIS_FILE //反定义,即清除THIS_FILE的宏定义
static char THIS_FILE[] = __FILE__;
#endif //结束宏定义
_cplusplus表示是否是C++
如下为宏定义:
#ifdef _DEBUG //如果定义了_DEBUG
#define new DEBUG_NEW //则定义new为DEBUG_NEW
#undef THIS_FILE //反定义,即清除THIS_FILE的宏定义
static char THIS_FILE[] = __FILE__;
#endif //结束宏定义
__FILE__标准C++推荐编译器实现时预定义的宏
看看Thinking in C++(C++编程思想)
看看Thinking in C++(C++编程思想)
__FILE__是由编译器定义的宏,表示当前文件名。
常用于调试。报告错误时,我们可以方便地知道是哪个文件出错
常用于调试。报告错误时,我们可以方便地知道是哪个文件出错
- #undef THIS_FILE static char THIS_FILE[] = __FILE__;
- C++ static char THIS_FILE[] = __FILE__;
- C++ static char THIS_FILE[] = __FILE__;
- C++ static char THIS_FILE[] = __FILE__
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #endif
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #endif
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #endif
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW...
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW...
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW...
- 关于MFC中的#ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #endif
- #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif 语句解释
- 关于MFC中的#ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #endif
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif
- #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif
- #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif 语句解释
- char c=128;
- __FILE__
- 无法打开 libboost_regex-vc80-mt-sgd-1_51.lib
- 第十周上级任务1解法2
- 乘法口诀
- Oracle导入SQL脚本执行和常用命令大全
- 九九乘法表。
- C++ static char THIS_FILE[] = __FILE__;
- 更新order的item的custom option的值
- [转]漫谈社区PHP 业务开发
- 1000以内的完数和(第十周上机任务)
- 找100-999之间的“水仙花数”。
- IOS用UINavigationController实现在两个页之间导航(下)
- 我来了
- uva_108 - Maximum Sum
- LuceneInAction(第2版)学习笔记——第一章 初识Lucene