利用指针对数组进行初始化

对一个数组进行初始化,使数组中的全部元素所有为0,这个操做是很简单的。最简便的方法就是在对数组进行定义时就对其初始化:数组 #include <stdio.h> #define LEN 5 int main(){ int arr[LEN] = {0}; int i = 0; for(;i < LEN;i++) printf("%d ",arr[i]); printf("\n"); return 0
相关文章
相关标签/搜索