C Array of String
In this section you will learn how to create an array of string in C.
A String is an array of char
objects. An array of string can be declared and handled like a 2d(two
dimensional) arrays. You can see
in the given example that we have declare a 2 dimensional character array
consisting of three 'rows' and twelve 'columns'. The array is initialized with
three character strings. In C, a format specifier %s is used with the printf to
print the string.
Here is the code:
ARRAYSTR.C
#include <stdio.h>
|
Output will be displayed as:
ARRAYSTR.EXE