字符串解析
解析用空格分隔单词的字符串:
void Analysis(char string[])
{
if(string == NULL)
{
return;
}
int index = 0;
while(isspace(string[index]))
{
index++;
}
int startIndexOfWord = index;
int endIndexOfWord;
while(string[index] != '\0')
{
if(isspace(string[index]))
{
endIndexOfWord = index - 1;
ParseWord(string,startIndexOfWord,endIndexOfWord);
index++;
while(isspace(string[index]))
{
index++;
}
startIndexOfWord = index;
}
else
{
index++;
}
}
}

浙公网安备 33010602011771号