C语言 分词并显示 写函数?

C语言 分词并显示 写函数?,第1张

void Input (char *str) {

char c

int i = 0

while ( (c = getchar()) != '\n' &&i <81) {

* (str + i) = c

i++

}

}

int Split_Count (char *str, char **pStr) {

int count = 0, is_word = 0, j = 0

char tmp[81]

for (int i = 0i <strlen (str)i++) {

if (* (str + i) == ' ') {

if (is_word == 1) {

ss:

* (tmp + j) = '\0'

*pStr = (char *) malloc (strlen (tmp) * sizeof (char))

strcpy (*pStr, tmp)//调试了一下,到这行就出错

pStr++

j = 0

}

is_word = 0

} else {

if (is_word == 0) {

count++

}

* (tmp + j) = * (str + i)

j++

is_word = 1

if (i == strlen (str) - 1)

goto ss

}

}

return count

}

1、打开myeclipse工具,点击File,选择Import 2、选择导入类型是已经存在的maven项目,然后next。 3、点击Browse选择下载好的maven项目源码,点击finish 4、然后会卡顿一段时间,因为maven项目不需要手动导入jar文件,maven项目会自动下载所需要


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/11816539.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-18
下一篇2023-05-18

发表评论

登录后才能评论

评论列表(0条)

    保存