feof stuff...

This is a discussion on feof stuff... within the C Programming forums, part of the General Programming Boards category; if i want to read from a file until the end of a file.. i would do this.. struct line ...

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

    feof stuff...

    if i want to read from a file until the end of a file.. i would do this..
    struct line
    {
    int p1;
    int p2;
    }
    typedef line Line;
    Line Lines [5];

    FILE *fptr
    /* file open and stuff */
    while (fscanf(fptr, "%d%d",Lines[i].p1, Lines[i].p2) != feof)){
    i++;}
    fclose (fptr);

    im getting an error..
    i dont know whats wrong..

  2. #2
    eh ya hoser, got a beer? stumon's Avatar
    Join Date
    Feb 2003
    Posts
    323
    Try not to use while != feof. Read this
    The keyboard is the standard device used to cause computer errors!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tab key stuff. C+WinAPI is killing me. Please help.
    By Templario in forum Windows Programming
    Replies: 5
    Last Post: 11-21-2002, 02:35 PM
  2. arguments, directories and stuff...
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 06-26-2002, 05:46 PM
  3. Your stuff
    By smog890 in forum C Programming
    Replies: 6
    Last Post: 06-13-2002, 11:50 PM
  4. Linked lists and file i/o, and some other stuff
    By ninja in forum C++ Programming
    Replies: 9
    Last Post: 05-19-2002, 07:15 PM
  5. Stocks 'n' stuff...
    By Cheeze-It in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 09-20-2001, 05:36 PM

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