Update array.md

填充数组与链表/数组(Array)中C语言数组的初始化
This commit is contained in:
ayuan 2023-01-03 13:58:51 +08:00 committed by GitHub
parent e850152130
commit 886fb4bf53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,10 @@ comments: true
=== "C"
```c title="array.c"
/* 初始化数组 */
int nums[8] = {1, 2, 4, 8, 16 ,32 ,64}; /* 从ANSI C开始支持这种初始化 即完全初始化 */
int arr[5] = {1, 2}; /* 不完全初始化 未初始化的元素会被置0 */
int days[12] = {31, 28, [4] = 31, 30, 31, [1] = 29}; /* 从C99开始支持 指定初始化器 即指定数组中某一位元素的数值 */
```
=== "C#"