Search:

Type: Posts; User: laserlight

Search: Search took 0.33 seconds.

  1. Replies
    26
    Views
    2,761

    fopen returns a null pointer if the file failed...

    fopen returns a null pointer if the file failed to be opened. !fp evaluates to 1 if fp is a null pointer, hence if !fp evaluates to 1, the file failed to be opened.

    Perhaps it would be easier to...
  2. Replies
    26
    Views
    2,761

    Ugh, I still blundered: your file was opened...

    Ugh, I still blundered: your file was opened correctly. What's inside?
  3. Replies
    26
    Views
    2,761

    Yes (though I was confused for a moment because I...

    Yes (though I was confused for a moment because I think of a file not opening as "failure", not "success" :p). If the file path is correct, check file permissions.
  4. Replies
    26
    Views
    2,761

    Well... Check that the file was opened...

    Well...

    Check that the file was opened correctly.
    Do not use feof to control a loop like that; rather, use the return value of fgets.
Results 1 to 4 of 4