ifstream binary gets to eof?

This is a discussion on ifstream binary gets to eof? within the C++ Programming forums, part of the General Programming Boards category; I have some code (too much to post here) that is reading a 200-ish kb file in binary mode with ...

  1. #1
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204

    Thumbs up ifstream binary gets to eof?

    I have some code (too much to post here) that is reading a 200-ish kb file in binary mode with fstream. For some reason, it gets halfway through the file and then sets the eof flag. I can't seem to find any problems in my code, so I'm thinking that there may be a known problem or maybe something else involved to get this working?

    Thanks.

  2. #2
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    Not to worry, I figured it out. I forgot to actually put in the std::ios::binary...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 11-04-2006, 10:07 AM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 08:40 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  5. files won't stop being read!!!
    By jverkoey in forum C++ Programming
    Replies: 15
    Last Post: 04-10-2003, 05:28 AM

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