static const char *msg[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
char *get_a_day(int idx)
{
static char buf[20];
strcpy(buf, msg[idx]);
return buf;
}
int main()
{
char *day0 = get_a_day(0);
char *day1 = get_a_day(1);
printf("%s %s\n", day0, day1);
return 0;
}
结果是什么?