Re[2]: Re: Read a binary file

From: Anton Korneev <tosha_korneev_at_tut.by>
Date: Tue, 30 Sep 2008 14:45:02 +0300


Hello Manungu,

  if you read file header to some struct you should define your struct with   custom aligment, like this:

    #pragma pack(push,1)

    struct WAVEDESC {
      ...
    }

    #pragma pack(pop)

Anton

Tuesday, September 30, 2008, 1:13:06 AM, you wrote:
> Hi Rene,

> This is certainly going to work, but if the binary header is saved with a
> specific format and has a header. Is the same ifstream myFile
> ("myfile.dat", ios::in | ios::binary) instruction going to work as well? I
> am getting into trouble so far. Help please.

> Joseph

>>     ifstream myFile ("myfile.dat", ios::in | ios::binary);
>>
>>
>> Rene Brun
>>
>> Manungu kiveni wrote:
>>> Hi Rene,
>>>
>>> I wanted to know how do you read a binary file in root. Binary format
>>> is a bit peculiar and if you use the same if stream and of stream as
>>> for the other format, nothing works. Any suggestions?
>>>
>>> Thank you.
>>> Joseph
>>>
>>>
>>




-- 
Best regards,
 Anton
Received on Tue Sep 30 2008 - 13:45:05 CEST

This archive was generated by hypermail 2.2.0 : Tue Sep 30 2008 - 23:50:01 CEST