【发布时间】:2018-08-22 23:37:10
【问题描述】:
为什么 C99 中引入的布尔类型支持使用预处理器而不是语言自己的工具?具体来说,为什么我们有:
#define bool _Bool
#define true 1
#define false 0
在<stdbool.h> 而不是:
typedef _Bool bool;
enum { false = 0, true = 1 };
我想枚举可以看作是一个品味问题。但是 - 为什么没有 typedef?
【问题讨论】: