2019年8月10日
摘要: 代码需要使用c99编译 阅读全文
posted @ 2019-08-10 20:02 你不知道的浪漫 阅读(2280) 评论(0) 推荐(0) 编辑
摘要: 1、不能在[]给定大小 2、不要在被调用函数里使用sizeof(a)/sizeof(a[0])形式传递数组大小,直接给出数组长度,或者在 主调函数中使用sizeof(a)/sizeof(a[0])传递长度 阅读全文
posted @ 2019-08-10 19:44 你不知道的浪漫 阅读(2462) 评论(0) 推荐(0) 编辑
摘要: #include #include int main() { int a[6] = {[1]=2,4,[5] =6}; for(int i = 0 ; i < 6; i++) { printf("a[%d]:%d\t",i,a[i]); } return 0; } 输出: a[0]:0 a[1]:2 a[2]:4 a... 阅读全文
posted @ 2019-08-10 19:33 你不知道的浪漫 阅读(478) 评论(0) 推荐(0) 编辑
摘要: #include #include int main() { int arr[6] = {0}; //每个值默认0 for(int i = 0; i < len; i ++) printf("%d\n",arr[i]); return 0; } 输出======================================== 0 0 0 0 0 ... 阅读全文
posted @ 2019-08-10 19:10 你不知道的浪漫 阅读(1628) 评论(0) 推荐(0) 编辑