From 45d293438626180ccf2f4f58ac83eb5824cebfcb Mon Sep 17 00:00:00 2001 From: C_YouShao <2936840566@qq.com> Date: Wed, 21 Dec 2022 16:25:29 +0800 Subject: [PATCH 1/3] add initialization of C++ arrays --- docs/chapter_data_structure/data_and_memory.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/chapter_data_structure/data_and_memory.md b/docs/chapter_data_structure/data_and_memory.md index 930f3762..5d492246 100644 --- a/docs/chapter_data_structure/data_and_memory.md +++ b/docs/chapter_data_structure/data_and_memory.md @@ -57,7 +57,11 @@ comments: true === "C++" ```cpp title="" - + /* 使用多种「基本数据类型」来初始化「数组」 */ + int numbers[5] = {0}; + float decimals[5] = {0}; + char characters[5] = {'0','0','0','0','0'}; + bool booleans[5] = {0}; ``` === "Python" From 1131309783213bd98e6c6e8e0654da89433efd84 Mon Sep 17 00:00:00 2001 From: WSL0809 <48207171+WSL0809@users.noreply.github.com> Date: Sat, 24 Dec 2022 21:57:15 +0800 Subject: [PATCH 2/3] Update data_and_memory.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用多种「基本数据类型」来初始化「数组」的 C 语言版本 --- docs/chapter_data_structure/data_and_memory.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/chapter_data_structure/data_and_memory.md b/docs/chapter_data_structure/data_and_memory.md index 4fc32f05..4e45b631 100644 --- a/docs/chapter_data_structure/data_and_memory.md +++ b/docs/chapter_data_structure/data_and_memory.md @@ -88,6 +88,11 @@ comments: true === "C" ```c title="" + /* 使用多种「基本数据类型」来初始化「数组」 */ + int numbers[10]; + float decimals[10]; + char characters[10]; + bool booleans[10]; ``` From f90f15c77de07f69c938f1c170aba3e042f2390e Mon Sep 17 00:00:00 2001 From: Yudong Jin Date: Sat, 24 Dec 2022 22:21:17 +0800 Subject: [PATCH 3/3] Update data_and_memory.md --- docs/chapter_data_structure/data_and_memory.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/chapter_data_structure/data_and_memory.md b/docs/chapter_data_structure/data_and_memory.md index 5d492246..016419d9 100644 --- a/docs/chapter_data_structure/data_and_memory.md +++ b/docs/chapter_data_structure/data_and_memory.md @@ -58,10 +58,10 @@ comments: true ```cpp title="" /* 使用多种「基本数据类型」来初始化「数组」 */ - int numbers[5] = {0}; - float decimals[5] = {0}; - char characters[5] = {'0','0','0','0','0'}; - bool booleans[5] = {0}; + int numbers[5]; + float decimals[5]; + char characters[5]; + bool booleans[5]; ``` === "Python"