comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: read a C written binary file with IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: read a C written binary file with IDL [message #79229] Fri, 10 February 2012 08:02 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Cool! I did not know that.

cheers,

paulv


Bill Nel wrote:
> On Feb 9, 11:56 pm, Manodeep Sinha <manod...@gmail.com> wrote:
>> Hi,
>>
>> This is because C pads the structure to produce alignments. Under
>> 'normal' operations, you would expect MyStruct to be 20 bytes,
>> however, if you do a sizeof(struct MyStruct), you will probably see
>> that the size is 24. (And you can enable the warning for gcc by using
>> the compile time option -Wpadded).
>
>
> The N_TAGS() function has LENGTH and DATA_LENGTH keywords:
>
> IDL> print, n_tags(mystruct, /length)
> 24
> IDL> print, n_tags(mystruct, /data_length)
> 20
>
> I mention it because one might not think to look at the N_TAGS
> function
> for this sort of information.
>
> --Wayne
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: tracking clusters through multiple timesteps
Next Topic: Making a html image map?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:09:53 PDT 2025

Total time taken to generate the page: 0.00669 seconds