Reading Bytes from File

This is a discussion on Reading Bytes from File within the C++ Programming forums, part of the General Programming Boards category; I'm very new to doing stuff like this and I'm confused as to how it is done. I want to ...

  1. #1
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728

    Reading Bytes from File

    I'm very new to doing stuff like this and I'm confused as to how it is done. I want to store data 48 bits of data to file which during my program are in the form of 6 char variables, how would I do this? Would I just save the chars in a text file or since all I care about are their bits is there a different and possibly faster way? I also want to be able to read these 48 bits from file quickly and I'm quite sure that if they are in the form of a char string that I would have to parse it and thus slow down the process.

    Hope this makes sense!

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Consider ofstream write().

    Kuphryn

  3. #3
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Okay, I found a great tutorial on the read and write functions, thanks for the help!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  2. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  3. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  4. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 02:58 PM
  5. Reading Certain number of bytes from a file
    By (TNT) in forum Windows Programming
    Replies: 6
    Last Post: 01-14-2002, 07:35 PM

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