摘要: # include <stdio.h># include <string.h># include "myhead.h"#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) int main(void){ char name[] ="jason"; name 阅读全文
posted @ 2018-11-23 09:27 Peequeue 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 首先对于一维数组,如: char a[]={1,2,3,4};int b[]={1,2,3,4,5};float c[]={1.0,2.0,3.0};如何求取这些数组的长度呢?可以使用sizeof(),但由于sizeof()返回的是字节长度,所以可以使用sizeof(x)/sizeof((x)[0] 阅读全文
posted @ 2018-11-23 09:21 Peequeue 阅读(7944) 评论(0) 推荐(0) 编辑