Array Initialization in C
For Complete YouTube Video: Click Here
In this class, we will understand Array Initialization in C.
We have covered how to declare an array in our previous class, but we haven’t initialized an array.
Table of Contents
Array Initialization
The image below shows how to initialize an array.
In the array initialization, we have to use curly braces to provide the elements of an array.
The image below is an array after initialization.
Different ways of Array Initialization
There are different ways of an array initialization.
The below discussion is about different ways of array initialization.
In the above image, only a few values have been initialized.
In this kind of initialization, the remaining values are filled with zeros, as shown below.
The image below is a way of initialization where the values of the array are filled with zeros.
The values of the array after initialization is as shown below.