Array Initialization in C || Lesson 44 || C Programming || Learning Monkey ||

preview_player
Показать описание
Array Initialization in C

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
Different ways of Array Initialization

Array Initialization

The image below shows how to initialize an array.
Array Initialization in C
Array Initialization in C

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.
Array Initialization in C
Array with values
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.
Array Initialization in C with fewer values
Array Initialization in C with fewer values

In this kind of initialization, the remaining values are filled with zeros, as shown below.
Array Initialization in C with fewer values visualization
Array with fewer values visualization

The image below is a way of initialization where the values of the array are filled with zeros.
Array Initialization in C with all values assigned to 0
Array with all values assigned to 0

The values of the array after initialization is as shown below.
Array Initialization in C with all values assigned to 0 visualization
Array with all values assigned to 0 visualization

#learningmonkey #cprogrammingforbeginners #placements #gatecse #cprogramming #cprogramminglanguage

Link for playlists:

Рекомендации по теме
Комментарии
Автор

Thank you so much!! I had a lecture and I faced this problem why int arr[10]={0} makes all the elements in the array to ZEO? I wasn't understanding this part what does it mean when int arr[10]={0}?? But after watching your video I got it.

nawar
Автор

Sir c programming ka chapter full upload kariea pls exam ahead pls sir

diptislenka