1language[0] => "Java";
2language[1] => "Python";
3language[2] => "C++";
4language[3] => "HTML";
5language[4] => "SQL";
1// it is valid
2char language[ ][10] = {"Java", "Python", "C++", "HTML", "SQL"};
1char ch_arr[3][10] = {
2 {'s', 'p', 'i', 'k', 'e', '\0'},
3 {'t', 'o', 'm','\0'},
4 {'j', 'e', 'r', 'r', 'y','\0'}
5 };
1#include <stdio.h>
2
3int main()
4{
5 char str[5][10];
6
7 printf("enter the strings...\n");
8 for(int i =0; i < 5; i++)
9 scanf("%s", str[i]);
10
11 printf("All strings are...\n");
12 for(int j =0; j < 5; j++)
13 printf("%s\n", str[j]);
14}
15
1#define ROW 3
2#define COL 3
3int main(int argc, char *argv[])
4{
5 int i, j;
6 char *matrix[ROW][COL] = {
7 {"aa", "bb", "cc"},
8 {"dd", "ee", "ff"},
9 {"gg", "hh", "ii"},
10 };
11
12 for(i = 0; i < ROW; i++){
13 for(j = 0; j < COL; j++){
14 printf("matrix[%d][%d] is %s\n", i, j, matrix[i][j]);
15 }
16 }
17
18 return 0;
19}
20