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] 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 930f37622..5d4922469 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"