Thread: File I/O

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    32

    File I/O

    Hello ~

    I'm creating a DLL that (basically) reads and writes ID3 data from MP3s. How can I, using the Standard Library (or fstream.h), read exactly 30 bytes, then another lump of data of specific size etc etc, while incrementing the file handle each time? (it might do this automatically, I don't know). I've only done text files before, and I don't know how to read actually bytes of data. Would arrays help here?

    Thanks ~

    Chris Howarth

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Yes, you can use <fstream> from the standard library to read ID3 tags from MP3 files. After all, MP3 files are just files with binary data. The member functions seekg() and get() may come in handy, and remember to read in binary mode.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Mar 2007
    Posts
    32
    Oh yes, thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  3. 2 questions surrounding an I/O file
    By Guti14 in forum C Programming
    Replies: 2
    Last Post: 08-30-2004, 11:21 PM
  4. File I/O problems!!! Help!!!
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 05-17-2002, 08:09 PM
  5. advice on file i/o
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 11-29-2001, 05:56 AM