Results 1 to 2 of 2

Thread: Reading binary data in C++

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    280

    Reading binary data in C++

    I'm trying to write a program to read a binary file. Everything is divided into 4-byte segments. I'm using the Qt libraries, FYI. What would be the best way to read in the information and then convert that into what ever form it needs to be in (like a string or an integer)? Thanks.

  2. #2

    Re: Reading binary data in C++

    Read in 4 unsigned chars at a time (4 bytes), then manipulate them (remember byte ordering if necessary). Cast them as appropriate, etc. You could use an unsigned char array, fill it from an fstream, etc. Should be easy.

Similar Threads

  1. Visio's Database Links
    By The Donald in forum Windows - General Topics
    Replies: 0
    Last Post: 01-05-2005, 06:32 AM
  2. Windows 2000 Hardware Compatibility List
    By regix in forum Windows - General Topics
    Replies: 11
    Last Post: 01-04-2005, 08:20 AM
  3. New Features that are included in Access 2000
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-01-2005, 02:17 AM
  4. GL not working ati 7000
    By Mip in forum Linux - Software, Applications & Programming
    Replies: 19
    Last Post: 10-28-2004, 09:29 PM
  5. Where should I store my data?
    By t048 in forum Linux - Software, Applications & Programming
    Replies: 6
    Last Post: 07-13-2002, 07:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •