K&R demonstrates an example of initializing a pointer array as follows:
char *month_name(int n)
{
static char *name[] = {
"Illegal month",
"January", "February", "March",
"April", "May", "June",
"July", "August", "September",
"October", "November", "December"
};
return (n < 1 || n > 12) ? name[0] : name[n];
}
K&R states that "this is an ideal application for an internal static array". But why is this so? Why not just make this an automatic pointer array?