摘要: BOOL 定义typedef int BOOL;#define FALSE 0#define TRUE 1不能完全重载,如://file.h void f(int ); // okvoid f(BOOL); // ok //file.cppvoid f(int) {/*….*/} // okvoid f(BOOL) {/*….*/} // 错误,重新声明而bool(false,true)是C++内置的类型,可以避免上述的问题。bool在C++里是占用1字节,而BOOL是int类型,int类型的大小是视具体环境而定的;所以来说:false/true只占用1个字节,而 TRUE/FALSE视具体环 阅读全文
posted @ 2011-06-29 12:57 Charliee 阅读(873) 评论(0) 推荐(0) 编辑