求大神,哪里错了?
#include<stdio.h>
int main()
{
const char *week[7]={"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
int n;
printf ("请输入一个数字l:\n");
scanf ("%d", &n);
if (n>=1 && n<=7) printf ("星期%d的英文名是%s", n,*week[n-1]);
else printf ("数字无效\n");
return 0;
}
用[]运算符做地址偏移,用*运算符取内容,程序出错,哪里错了?