From f809383489418f1394e365b340f92b991b19e7da Mon Sep 17 00:00:00 2001 From: Tzupy Date: Wed, 26 Dec 2018 19:09:36 +0100 Subject: [PATCH] Added an initialization example with empty curly braces (#30973) --- guide/english/c/arrays-and-strings/index.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/guide/english/c/arrays-and-strings/index.md b/guide/english/c/arrays-and-strings/index.md index 115bf506c1..fb6556e7b1 100644 --- a/guide/english/c/arrays-and-strings/index.md +++ b/guide/english/c/arrays-and-strings/index.md @@ -26,6 +26,11 @@ float my_array[5] = {5.0, 2.5}; ``` If you partially initialize an array, the compiler sets the remaining elements to zero. +You can also initialize all elements of an array of a known size to zero using empty curly braces. For example: +```C +float my_array[5] = {}; +``` + Now that the array has been declared with 5 values, it has 5 memory locations. Consider this table for a visual example of that: | Position | 0 | 1 | 2 | 3 | 4 |