keil软件编arm程序报错,求解(附代码)?
报错提示语:
argument of type "char (*)[50]" is incompatible with parameter of type "char;
附代码:
case 2:
{
SPI_LCD_StringLineDisplay(Line3, " Passenger/Limit 2/3 ");
SPI_LCD_StringLineDisplay(Line4, " Direction: guangzhou ");
SPI_LCD_StringLineDisplay(Line5, ATR_Buffer[] );//这行报错
break;
}
注释:
1.ATR_Buffer[] 被定义为char*指针数组;
2.void SPI_LCD_StringLineDisplay(u8 Line_Num, char *Sptr)
{
u32 i = 0;
u16 reference_column = 0;
/* Send character by character on LCD */
while((*Sptr != 0) & (i < 20))
{
SPI_LCD_CharDisplay(Line_Num, reference_column, *Sptr);
/* Increment the column position by 16, because character is size of 16x24 */
reference_column += 16;
/* Point to the next character */
Sptr ++;
/* Increase the character counter */
i ++;
}
}
[解决办法]
SPI_LCD_StringLineDisplay(Line5, ATR_Buffer[] );//这行报错
改成
SPI_LCD_StringLineDisplay(Line5, ATR_Buffer );//这行报错
[解决办法]
ATR_Buffer[]只在定义变量时用,实际使用时必须有准确的下标,比如
SPI_LCD_StringLineDisplay(Line5, ATR_Buffer[3] );