在C中查找特定单词

在C中查找特定单词,c,search,C,Search,我正试图用C语言编写一个程序,在这个程序中,我必须输入另一个java文件并找到一个特定的单词,如class 我该怎么做?当然可以。如果您告诉我们您尝试了什么以及出现了什么问题,我们可能会提供帮助…函数(在中声明)(或POSIX,在中声明)可能有用:)请展开您的问题并演示您已经尝试过的内容。Stack Overflow社区在这里提供帮助,但您不能期望它编写所有代码。谢谢 . open the file as 'text' for reading . while end-of-file not re

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


我该怎么做?

当然可以。如果您告诉我们您尝试了什么以及出现了什么问题,我们可能会提供帮助…函数(在
中声明)(或POSIX,在
中声明)可能有用:)请展开您的问题并演示您已经尝试过的内容。Stack Overflow社区在这里提供帮助,但您不能期望它编写所有代码。谢谢
. 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