...need an example of fgets...

This is a discussion on ...need an example of fgets... within the C++ Programming forums, part of the General Programming Boards category; ...I am searching for a particular string that exists repeatedly in a text file....is fgets a good method to use?...if ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    40

    ...need an example of fgets...

    ...I am searching for a particular string that exists repeatedly in a text file....is fgets a good method to use?...if so what are the three parameters?? Is the first parameter is the string I am looking for and the last the file I am looking through?...and what does the integer in the middle represent? the books I have do not go into detail at all and do not specify the parameters...thank you in advance for your help...

  2. #2
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    fgets() is really for C use, although you can use it in C++ if you want. Here's an example

    If you want C++ IO, use fstreams and getline()
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    40
    ...thank you...

    ...sorry I started a previous thread with "I need help...".

    ...dumb broad here...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fgets not working after fgetc
    By 1978Corvette in forum C Programming
    Replies: 3
    Last Post: 01-22-2006, 05:33 PM
  2. problem with fgets
    By learninC in forum C Programming
    Replies: 3
    Last Post: 05-19-2005, 08:10 AM
  3. problem with fgets
    By Smoot in forum C Programming
    Replies: 4
    Last Post: 12-07-2003, 02:35 AM
  4. fgets crashing my program
    By EvBladeRunnervE in forum C++ Programming
    Replies: 7
    Last Post: 08-11-2003, 12:08 PM
  5. help with fgets
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 10-17-2001, 08:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21