Array of Strings in C || Lesson 70 || C Programming || Learning Monkey ||

preview_player
Показать описание
The array of Strings in C

In this class, we will try to understand the Array of Strings in C.

We have already covered the concepts on strings in our previous classes.
Array of Strings

In C, we have a provision to create an array of strings.

So far, in our previous classes, we have seen how to create a string (an array of characters).

An array of strings is an array with more than one string.

As we have already that we can create an array of arrays by declaring a two-dimensional array.

In the same way, we can create an array of strings by using a two-dimensional array.

The image is the program to understand the concept of an array of strings.

The second line in the above code is the declaration of an array of strings.

In the above declaration, we have created an array of four strings

If the initialization is done in the declaration, there is no need to declare rows, and the compiler automatically took those rows.

The program is to find the planets whose names start with ‘M’.

In our example, we have two planets, Mercury and Mars.

We have used the rows and columns to access a specific character in the string in the if condition.

If the character is equal to ‘M,’ then we will print the entire string.

To access the entire string, we have to use only the row number.

To access a character in the string, we have to use both row and column numbers.

In the above example, we have initialized the array, but we will allow the user to enter the details in this example.

The first for loop in the above example is to allow the user to give the string inputs.

The remaining part of the program is the same as the above example.

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

Link for playlists:

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

Sir me class mataram vera leval sir akada nerchukunnru sir

SaiKumar-yovw
Автор

Oda yr padhon lga tu Mari english jana tenu ni pta nayaneya nu padhaida kida aaa

haseyandakhijana