looping fscanf

This is a discussion on looping fscanf within the C Programming forums, part of the General Programming Boards category; Hi Let me just start by saying that i'm new to programming. I'm using the fscanf function to read some ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    2

    looping fscanf

    Hi
    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
    Posts
    335
    maybe rewind() ?

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    2
    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
    Location
    Sydney
    Posts
    60
    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-29-2008, 12:11 AM
  2. fscanf in different functions for the same file
    By bchan90 in forum C Programming
    Replies: 5
    Last Post: 12-03-2008, 09:31 PM
  3. fscanf help
    By Axel in forum C Programming
    Replies: 13
    Last Post: 10-22-2006, 11:44 PM
  4. Looping questions
    By Peyote in forum C++ Programming
    Replies: 3
    Last Post: 09-16-2003, 12:01 AM
  5. fscanf on sun's
    By brif in forum C Programming
    Replies: 2
    Last Post: 04-14-2002, 02:22 PM

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