关于指针函数,高手解答一下
#include "stdio.h"char *monthname(char *p[],int n);
void main()
{
char *months[]={"January","February","March","April","May","June","July","August","September","October","November","December"};
int n;
printf("输入月份:");
scanf("%d",&n);
if(n<=12&&n>=1)
printf("%d月份的英文名称是%s\n",n,monthname(months,n));
else
printf("输入的月份无效!");
}
char *monthname(char *p[],int n)
{
return *(p+n-1);
}
为什么在主函数里调用函数monthname(),而不是*monthname()?char *monthname(char *p[],int n);定义的函数怎么解释?小弟是新手,看不懂。