This commit is contained in:
krahets
2023-10-26 22:28:34 +08:00
parent d71e2dd46b
commit 25ac5de466
2 changed files with 36 additions and 35 deletions

View File

@@ -30,7 +30,7 @@ comments: true
/* 初始化数组 */
// 存储在栈上
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* nums1 = new int[5] { 1, 3, 2, 5, 4 };