error: cannot convert 'char**' to 'char*' in initialization for strings I am making C console menu program. And I am stuck with the char* assignment. Is there any good method to assign char* to char**? The code is as below: char* group0[14]= {//group0:5"Funciton0-1","Fun...
char animal[5][8] = {"dog", "cat", "horse", "hamster", "turtle"}; char name[15]; int age; int main() { srand(time(0)); char* Plocation = &location[rand()%5]; //[Error] cannot convert 'char (*)[20]' to 'char*' in initialization ...
类型错误,多是你把一个二维数组名传给一个指向某种数据类型的指针 要传递也是传递给指向指针的指针
这个错误的意思是说,在函数初始化的时候,无法将一个char(字符)转换成一个char*(字符指针)。这个错误发生在你的void zhuanhuan(int n)函数开头,即:char*t=char(n+'0');解决办法是,创建一个新字符,即加上一个关键字new即可:char*t = new char(n+'0');...
include <stdio.h> //#include <string.h> void main(){ struct ren { int age;char sex;int height;int weigth;} ren={12, 'M' ,1.67, 67};//M 应该是字符,而不是字符串 printf("%ld\n",ren.age);}
char [2]类型不能转换为char类型 原因:类型不匹配,char[2]是长度为2的字符数组,而char是字符变量
【题目】error C2440:'=':cannot convert from 'char *' to 'char'#include using namespacestd; int min(int a, int b); float min(float a,float b); char * min (char * a, char * b); voidmain() { int min(int a, int b); float min(float a, float b); char* min (char *...
error C2440: '=' : cannot convert from 'char *' to 'char'#include using namespace std; int min(int a, int b); float min(float a, float b); char * min (char * a, char * b); void main() { int min(int a, int b); float min(float a, float b); char * min (char ...
error C2440: '=' : cannot convert from 'char [2]' to 'char'中文对照:(编译错误)赋值运算,无法从字符数组转换为
你传入strcmp的第一个参数是char**类型,所以报错。在第一个参数前再加上*即可编译通过。