接收2个字节, TEMP[2]=0; memcpy(str, TEMP, 3);
编译错误
main.c(38): error: #144: a value of type "char *" cannot be used to initialize an entity of type "uint8_t"
uint8_t str="1234567890";
main.c(81): error: #167: argument of type "uint8_t" is incompatible with parameter of type "void *restrict"
memcpy(str,TEMP,3);
TEMP[8] = 0;
memcpy(str, TEMP, 9);
评分
查看全部评分
str = temp;
uint8_t TEMP[3];
uint8_t *str=0;
memcpy(str,TEMP,3);编译成功,但是程序执行到memcpy(str,TEMP,3);系统直接死机?不知道是什么原因,是数据类型定义错误??
uint8_t TEMP[3];
uint8_t str=0;
memcpy(str,TEMP,3);
编译失败,错误信息如下:
main.c(81): error: #167: argument of type "uint8_t" is incompatible with parameter of type "void *restrict"
memcpy(str,RxBuffer1,3);
如果要收3个字节, TEMP[3]=0; memcpy(str, TEMP, 4);
初始化 uint8_t str = "1234567890"; uint8_t TEMP[3];
接收2个字节, TEMP[2]=0; memcpy(str, TEMP, 3);
编译错误
main.c(38): error: #144: a value of type "char *" cannot be used to initialize an entity of type "uint8_t"
uint8_t str="1234567890";
main.c(81): error: #167: argument of type "uint8_t" is incompatible with parameter of type "void *restrict"
memcpy(str,TEMP,3);