VS 没有STDBOOL.H 怎么办
RT 在论坛里找到了这个代码
C/C++ code
/*
stdbool.h
-- Boolean type and values
(substitute for missing C99 standard header)
public-domain implementation from [EMAIL PROTECTED]
implements subclause 7.16 of ISO/IEC 9899:1999 (E)
*/
#ifndef __bool_true_false_are_defined
#define __bool_true_false_are_defined 1
/* program is allowed to contain its own definitions, so ... */
#undef bool
#undef true
#undef false
#if __STDC_VERSION__ < 199901
typedef int _Bool
#endif
#define bool _Bool
#define true 1
#define false 0
#endif /* !defined(__bool_true_false_are_defined) */
加到代码里面就行了吗 怎么加?
[解决办法]
建个头文件添加进去即可
[解决办法]
你会不会新建头文件
新建一个.h文件。
直接把这段代码加进去,你引用即可。
其实这几句就可以了:
typedef int _Bool#define bool _Bool#define true 1#define false 0
[解决办法]
vc不支持c99标准。
改用支持c99标准的编译器吧,例如gcc。
[解决办法]
http://www.google.com/codesearch