Thread: Help with searching for word in files

  1. #1
    Registered User
    Join Date
    Nov 2020
    Posts
    8

    Help with searching for word in files

    Hi,
    so I've searching on how to have my code successfully search for a word in my file from the user input and display the info after that word but it's in vain. Can anyone please explain and show the example code of doing so?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    OK, you need
    - fopen
    - fgets
    - strstr

    Over to you.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. searching word using strcmp
    By Ph0x in forum C Programming
    Replies: 6
    Last Post: 11-15-2014, 12:19 PM
  2. searching for palindrome word in a sentence
    By c lover in forum C Programming
    Replies: 1
    Last Post: 05-04-2012, 12:48 PM
  3. Word Searching with an Index
    By Adak in forum C Programming
    Replies: 7
    Last Post: 10-22-2011, 02:38 AM
  4. Searching word(string) in matrix.
    By Aleremilcapo in forum C Programming
    Replies: 7
    Last Post: 09-22-2010, 09:41 PM
  5. Help with searching word lists
    By denizengt in forum C Programming
    Replies: 3
    Last Post: 10-02-2003, 02:03 PM

Tags for this Thread