char *[]为什么不能赋予字符地址呢?
#include<stdio.h>#include<stdlib.h>#include<string.h>intmain(){voidsort(char*name[],i...
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
void sort(char *name[], int n);
void print(char *name[], int n);
char * name[ ] = {"FOLLOW ME","BASIC","GREAT WALL","FORTRAN","COMPUTER DESIGN" };
system("pause");
return 0;
}
总是告诉我"const char *" 类型的值不能用于初始化 "char *" 类型的实体 展开
#include<stdlib.h>
#include<string.h>
int main()
{
void sort(char *name[], int n);
void print(char *name[], int n);
char * name[ ] = {"FOLLOW ME","BASIC","GREAT WALL","FORTRAN","COMPUTER DESIGN" };
system("pause");
return 0;
}
总是告诉我"const char *" 类型的值不能用于初始化 "char *" 类型的实体 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询