error C2440: “=”: 无法从“char **”转换为“char *”
#include<stdio.h>#include<stdlib.h>intmain(){inti;char**p;char*month[]={"January","Fe...
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i;
char **p;
char *month[]=
{
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
}; /*给指针数组中的元素赋初值*/
for(i=0;i<12;i++)
{
*p=month+i;
printf("%s\n",**p); /*输出指针数组中的各元素*/
}
system("pause");
}
为什么这样会报警。 展开
#include<stdlib.h>
int main()
{
int i;
char **p;
char *month[]=
{
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
}; /*给指针数组中的元素赋初值*/
for(i=0;i<12;i++)
{
*p=month+i;
printf("%s\n",**p); /*输出指针数组中的各元素*/
}
system("pause");
}
为什么这样会报警。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询