C語言數組初始化為0的方法有以下幾種:
int arr[10]; for(int i = 0; i < 10; i++) { arr[i] = 0; }
int arr[10] = {0};
<string.h>
int arr[10]; memset(arr, 0, sizeof(arr));