Counting words in a string?

后端 未结 4 506
被撕碎了的回忆
被撕碎了的回忆 2021-01-23 07:32

Hello for this program I am supposed to count the number of words in a string. So far, I have found out how to find the number of characters in a string but am unable to figure

4条回答
  •  自闭症患者
    2021-01-23 07:53

    There is a linux util 'wc' that can count words.

    have a look (it includes some explanation and a sample):

    http://en.literateprograms.org/Word_count_(C)

    and a link to the source

    http://en.literateprograms.org/index.php?title=Special:DownloadCode/Word_count_(C)&oldid=15634

提交回复
热议问题