char *getmonth( int n )
{
if(n>12 || n<=0) return NULL;
static char month[][10]={"January","February","March","April","May","June","July","Aguest","September","October","November","December"};
return &month[n-1];
{
if(n>12 || n<=0) return NULL;
static char month[][10]={"January","February","March","April","May","June","July","Aguest","September","October","November","December"};
return &month[n-1];
}
注意返回的取地址符
char *getmonth( int n )
{
if(n>12 || n<=0) return NULL;
static char *month[10]={"January","February","March","April","May","June","July","Aguest","September","October","November","December"};
return month[n-1];
}