预处理、const、static与sizeof-使用宏定义得到一个数组所含的元素个数 1:代码如下: #define ARR_SIZE(a) (sizeof((a)) / sizeof((a[0])))