请高手指教~~ 急啊~~
本例在AVR 中能够正确的运行,但是在ARM中缺老是报错,请看下例~~
typedef struct { unsigned char uc1; unsigned char uc2; unsigned char uc3; unsigned char uc4; } infor
struct infor = {0x12,0x13,0x14,0x15 };
int main(void )
{ unsigned char *ptr = NULL; unsigned char uc[5]; unsigned char i=0; ptr = uc;
for(i=0;i<3;i++) *(ptr++) = *((unsigned char *)infor+i );
while(1); return 0; }
报错:error: invaild type conversion 其实: ptr = ( char * )infor ; 就会报错的哦~~
上面的类型转换错误,在AVR 中是正确的。 请问,是不是要改编译器呢? 我改成GUN 编译器好像也不正确啊? AVR 用的就是GUN编译器啊~~ 急呀~~~~~
|