Sometimes, we need to create a table of related string values. This table, in one form or another, is often called a lookup table. Once we construct this table, we can then look up string values based on an index into the table. To declare a one-dimensional lookup table for the days of the week, where the array index is equal to the day of the week, we would make the following declaration:
char* weekdays[] = { "Sunday" ,
"Monday" ,
"Tuesday" ,
"Wednesday" ,
"Thursday" ,
"Friday" ,
"Saturday" };
Notice that the strings are of different sizes. Also, notice that they are all string literals; this is acceptable because these names won't change. We can then use this table to convert a numerical day of the week to print the day, as...