计算数组元素个数和计算字符串数组元素个数方法

来源:互联网 发布:我的人工智能贾维斯 编辑:程序博客网 时间:2024/05/20 23:30

计算数组元素个数方法

int len = sizeof(a)/sizeof(A)

 A 是结构体名, a是A的结构体数组名; 定义是 A  a[] {x,y,z,};

计算字符串数组元素个数

int lenth = sizeof(nlanoutput)/sizeof(nlanoutput[0]);

nlanoutput 是字符串数组; 定义是 unsigned char nlanoutput[][200];