Hello, wondering if someone can help me.

I'm working with a .wav file, and, I need to collect the header information. The header contains (roughly, 20 bits/bytes) before the actual data. And, each of this data is contained at different locations in the file. I need to read a particular amount of integers in the text. For example:

Data = 


For the first header information, I need to gather the first 4 integers.. So:

Data = {

The code that I have written, reads in the first integers, however, reads them like this:

  Data = {

This is obviously wrong, but, I can't figure out how to read the whole of the integer inside element[0]..[3] - Here is the code: (Data type is char)

bool Wav::readHeader(ifstream& dataIn)
    // READ and VALIDATE the Type
    dataIn.read(this->type, 4);

    for(unsigned i=0; (i < 4); i++)
        cout << this->type[i] << endl;
    // testing purposes
    return true;

Could anyone offer any solutions?

Thank you very much :)!

Well.. I offically feel stupid. Problem solved, It's late and my brain doesn't function after a certain time!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.