Update array.md (#890)

* Update array.md

* Update array.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
syd168 2023-10-26 22:22:19 +08:00 committed by GitHub
parent e441ee4e35
commit 356db47cd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,7 @@
/* 初始化数组 */ /* 初始化数组 */
// 存储在栈上 // 存储在栈上
int arr[5]; int arr[5];
int nums[5] { 1, 3, 2, 5, 4 }; int nums[5] = { 1, 3, 2, 5, 4 };
// 存储在堆上(需要手动释放空间) // 存储在堆上(需要手动释放空间)
int* arr1 = new int[5]; int* arr1 = new int[5];
int* nums1 = new int[5] { 1, 3, 2, 5, 4 }; int* nums1 = new int[5] { 1, 3, 2, 5, 4 };