Arrays of Strings
This lesson will teach how to make an array of strings using pointers.
We have seen that strings are just arrays of characters, terminated by a null character. We have also seen that the variables that hold strings (like arrays of other types, e.g. int
or double
, are actually pointers to the head of the array. We can use an array of pointers, where each pointer is a pointer to the head of a character array (in other words a string), to store an array of strings. Here is an example:
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy