C++ static char THIS_FILE[] = __FILE__
来源:互联网 发布:crm软件招标评分标准 编辑:程序博客网 时间:2024/05/02 00:56
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__是由编译器定义的宏,表示当前文件名。
常用于调试。报告错误时,我们可以方便地知道是哪个文件出错
常用于调试。报告错误时,我们可以方便地知道是哪个文件出错
0 0
- #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__
- 加速度计和陀螺仪指南
- 如何使用mysql存储树形关系
- Smack Connect 中的 connectionEstablishedListeners 属性用法及其作用
- 设计的两道面试题C++
- iOS应用程序国际化
- C++ static char THIS_FILE[] = __FILE__
- 《JAVA与模式》之状态模式(行为)
- android 修改statusbar(一)添加home back menu键
- 切换 SVN 用户名
- Serializable 和 Parcelable 区别
- Google C++ Style中允许使用的Boost库(1)
- Oracle 游标使用全解
- 星型拓扑结构
- GG命令帮助提示--Help