Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Assuming you're actually looking for a substring of a line in the file and not a word (which would require, as @elgonzo indicated, figuring out how to deal with spacing and word boundaries in gener...
Answer
#1: Initial revision
Assuming you're actually looking for a *substring* of a line in the file and not a *word* (which would require, as @elgonzo indicated, figuring out how to deal with spacing and word boundaries in general), you should look up information about the function `strstr`. But also, `strstr` wants to accept a string to search in, and you're currently reading your file one character at a time. Make your life easier and read up on `fgets` too.