代码如下:

int getString(char * source, char *strPtr[])
{
char* sta = source; char* mot = sta;
int count = 0;
while (*mot)
{
if (*mot == ' ')
{
*mot = '\0';
strPtr[count++] = sta;
sta = (mot + 1);
}
mot++;
}
strPtr[count++] = sta;
return count;
}

呃,对函数题出现格式错误这种错误感到非常奇怪,老师能帮忙看看代码哪有问题吗

Comments  

+1 # Moderator 2021-12-12 17:53
https://bbc3502.hopto.org/c2021/index.php/home-17/608-6-32-10-6
+1 # Moderator 2021-12-12 14:25
如果出现连续的空格,你怎么处理?

You have no rights to post comments