【问题标题】:In C finding specific words在 C 中查找特定单词
【发布时间】:2011-08-09 11:18:23
【问题描述】:

我正在尝试用 C 编写一个程序,在该程序中我必须输入另一个 java 文件并找到一个特定的单词,如 class

我该怎么做?

【问题讨论】:

  • 当然可以。如果您向我们展示您尝试了什么以及出了什么问题,我们也许可以提供帮助...
  • strcmp() 函数(在<string.h> 中声明)(或POSIX 的strcasecmp(),在<strings.h> 中声明)可能有用:)
  • 请扩展您的问题并展示您已经尝试过的内容。 Stack Overflow 社区随时为您提供帮助,但您不能指望它会编写您的所有代码。谢谢。

标签: c search


【解决方案1】:
. open the file as 'text' for reading
. while end-of-file not reached
.   read next line
.   parse/analyze line
.   if line contains "class"
.     here you got the specific word
. close the file

【讨论】:

    猜你喜欢
    • 2013-08-05
    • 1970-01-01
    • 2014-03-10
    • 1970-01-01
    • 1970-01-01
    • 2022-01-21
    • 2017-12-28
    • 2012-10-31
    • 1970-01-01
    相关资源
    最近更新 更多