指针在一点用法

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]);
}
main()
{
int i;
for(i=0; i<13; i++)
printf("%s/n", month_name(i));

}

你可能感兴趣的:(指针)