我收到以下错误,希望有人可以为我解释这些错误,因为我目前在 C 方面不是很好。
case ' ':
This is the error here. shellNew.c:57: error: a label can only be part of a statement and a declaration is not a statement
int rCheck = 0;
shellNew.c:58: error: expected expression before â
int foundPos = 0;
while(rCheck < 10)
{
if(inputBuffer[2] == historyBuffer[rCheck][0])
{
shellNew.c:63: error: â undeclared (first use in this function)
shellNew.c:63: error: (Each undeclared identifier is reported only once
shellNew.c:63: error: for each function it appears in.)
foundPos = rCheck;
}
rCheck++;
}
if(rCheck == 0)
{
printf("There was no command matching your criteria\n");
}
else
{
strcpy(inputBuffer, historyBuffer[rCheck]);
}
break;