`#include<reg51.h>
#include<string.h>
#include"_LCD_R8C.c"
unsigned char c[11];
void serial_int (void) interrupt 4
{
static unsigned char chr[11];
int i,j;
if (RI==1)
{
RI = 0;
TI = 0;
chr[11] = SBUF;
for(j=0;j<1;j++)
{
for(i=0;i<=10;i++)
{
c[i]=chr;
}
c[11]='\0';
}
}
}
int main() { unsigned char a[2][11]={"$0016221826","$0123456789"}; int i,j; lcd_init(); lcd_clear(); SCON = 0x50; TMOD = 0x20; TH1 = 0xFD; ET0 = 0; TR1 = 1; RI = 1; ES = 1; EA = 1; for(i=0;i<=1;i++) { **j=strcmp(a,c);** if(j==0) { lcd_printxy(1,1,"yes"); } else { lcd_printxy(1,6,"no"); } } }`
编译器在第 55 行(粗体)发出警告:指向不同对象的指针。数组到字符串的转换怎么样?这是对的吗?接收到的字符串应该与可用的字符串数组进行比较。