Content #
typeof有两种用法:
- 作用于表达式:
typeof (x[0](1))
This assumes that x is an array of pointers to functions; the type described is that of the values of the functions.
- 作用于类型:
typeof (int *)
Here the type described is that of pointers to int.
typeof定义maximum宏:
#define max(a,b) \
({ typeof (a) _a = (a); \
typeof (b) _b = (b); \
_a > _b ? _a : _b; })