void bubble (char cList[] ,int size) { // This is the line with the error
int swapped;
int p;
for (p = 1; p < size ; p++)
{
swapped = 0; /*this is to check if the array is already sorted*/
int j;
for(j = 0; j < size - p; j++)
{
if(cList[j] > cList[j+1])
{
int temp = cList[j];
cList[j] = cList[j+1];
cList[j+1] = temp;
swapped = 1;
}
}
if(!swapped)
{
break; /*if it is sorted then stop*/
}
}
}
这是我的代码片段。size
是我已经声明的常数。cList
是一组客户。我不断收到错误:
expected ';', ',' or ')' before numeric constant
有什么建议为什么会发生这种情况?