Thread: Problem reading a certain sized integer into a value from a file.

  1. #16
    Ethernal Noob
    Join Date
    Nov 2001
    So is there a "Safe" strategy to resolving the problem. Essentially I'm the only one going to be using this class, and most of the files generated are similar.

  2. #17
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    It really depends on the usage of the data. If all you ever do with it is, on the same computer architecture, write out files and read them back in, you can use the simplest format you can come up with.

    If you want to exchange data with other architectures, that's where the trouble starts.
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #18
    Ethernal Noob
    Join Date
    Nov 2001
    ok ok ok, I think i was reading the data wrong in the loop. Little endian means if I have a value such as

    0F FD;

    then the resulting number will be

    FD0F right. No wonder the other values were reading correctly when I read them.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  2. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  3. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. Problem reading file
    By winsonlee in forum C Programming
    Replies: 2
    Last Post: 04-23-2004, 06:52 AM