当前位置: 代码迷 >> 驱动开发 >> type "int" cannot be assigned to an entity of type "unsigned char *"该如何解决
  详细解决方案

type "int" cannot be assigned to an entity of type "unsigned char *"该如何解决

热度:176   发布时间:2016-04-28 10:47:48.0
type "int" cannot be assigned to an entity of type "unsigned char *"
菜鸟请教!
MDK 开发嵌入式程序


unsigned char *p;
p=str;
if(name==NULL)
{
  return 0;
}
p=str_cope(p,"<tr class=\"STYLE1\">");

unsigned char *str_cope(unsigned char *drc,unsigned char *src){
while( *src !='\0' )
{ *(drc++) = *(src++); }
return drc;
}

赋值语句为什么包类型不匹配呢?
..\Source\Web\web_str.c(101): error: #513: a value of type "int" cannot be assigned to an entity of type "unsigned char *"

------解决方案--------------------
把相关函数的完整代码贴上.
------解决方案--------------------
str 什么类型?
申请内存空间了?
  相关解决方案