Monday, 8. May 2006, 02:54:03
mfc, Microsoft, c++
Microsoft Foundation Classes, or MFC, is a Microsoft library that wraps portions of the Windows API in C++ classes, forming an application framework. Classes are defined for many of the handle-managed Windows objects and also for predefined windows and common controls. [via Wiki]
Thursday, 27. April 2006, 08:01:52
cpp, c++, #ifndef
常常在建立header file的时候需要先写一段文字
比如下面这段话
#ifdef HEADERFILENAME_H
#define HEADERFILENAME_H
class ClassName
{
...
};
#endif
那段#ifdef有必要写吗?
其实有些无写都不会影响代码的Runtime
不过对运行速度和文件大小有一定的影响
大概很多人很喜欢用#include来抓取文件吧
炎也很喜欢
总是在main.cpp中include一次
然后又在classfile.cpp中又使用一次
每次都include同样的Headerfile.h
这样就导致了Compiler运作的时候在link的时候会重复同样的headerfile内容
相同重复的内容出现就有可能导致不良的情况的发生
即时没有compilerError或者RunrimeError
也会让程序运行缓慢,想想看吧,在重复compiler一段Code之后产生的程序大小
这里还有更多相关的内容((#if, #ifdef, #ifndef, #else, #elif, #endif, and defined)