所以,我在第 83:9 行或斜杠所在的位置遇到括号问题。它告诉我“错误:预期标识符或‘{’ token 之前的‘(’”,我不明白我是如何收到此错误的。如果有人可以向我解释我是如何收到它的,谢谢。
不多
_Bool palindromes(char string[])
{
int i = 0;
while(string[i]=0 != '\0')
{
i++;
int last_place = i - 1;
for(int n=0; n<=last_place; n++)
{
if(string[n] == string[last_place])
{
last_place--;
continue;
}
if(n !=last_place)
{
return false;
}
}
}
}
{ //here is the bracket it's detecting
int i = 0;
while(string[i]=0 != '\0')
{
i++;
int last_place = i - 1;
for(int n=0; n<=last_place; n++)
{
if(string[n] == string[last_place])
{
return true;
}
}
}
}
最佳答案
如果您修复了您的身份
_Bool palindromes(char string[])
{
int i = 0;
while(string[i]=0 != '\0')
{
i++;
int last_place = i - 1;
for(int n=0; n<=last_place; n++)
{
if(string[n] == string[last_place])
{
last_place--;
continue;
}
if(n !=last_place)
{
return false;
}
}
}
} <---------- ups, function ends here
{ //here is the bracket it's detecting
int i = 0;
while(string[i]=0 != '\0')
这清楚地表明您的 }
太多了
关于c - 为什么我的代码中会出现此括号错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58777225/