Thread: looping fscanf

  1. #1
    Registered User
    Join Date
    Oct 2005

    looping fscanf

    Let me just start by saying that i'm new to programming.

    I'm using the fscanf function to read some data from a file. This data is processed and the result is stored.
    Now i want to return to the first fscanf read some new data and do the hole thing again.

    I was thinking about using a for-loop which should run as long as EOF is not reached. But i have no idea how the code should look.

    Any ideas?

  2. #2
    Learner Axel's Avatar
    Join Date
    Aug 2005
    maybe rewind() ?

  3. #3
    Registered User
    Join Date
    Oct 2005
    As I read it rewind() moves the me back to beginning of the file?
    I have ex. 3 sets of data to run. First I want to run set 1 then return run set 2 ect.

  4. #4
    Registered User
    Join Date
    Sep 2005
    fseek is probably what you are after then.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fscanf causes a SEGMENTATION FAULT
    By yougene in forum C Programming
    Replies: 15
    Last Post: 12-28-2008, 11:11 PM
  2. fscanf in different functions for the same file
    By bchan90 in forum C Programming
    Replies: 5
    Last Post: 12-03-2008, 08:31 PM
  3. fscanf help
    By Axel in forum C Programming
    Replies: 13
    Last Post: 10-22-2006, 10:44 PM
  4. Looping questions
    By Peyote in forum C++ Programming
    Replies: 3
    Last Post: 09-15-2003, 11:01 PM
  5. fscanf on sun's
    By brif in forum C Programming
    Replies: 2
    Last Post: 04-14-2002, 01:22 PM
Website Security Test