Even you know the size for 32 and 64 byte size of each field, you still
cannot know the offset of each of them because of alignment (packing).  One
way is to let C compiler to figure out.

Please refer to mysqlconst.c in data/ddmysql or netdefs.c in jsource.

There should be an article on C structure compiler of J in early Vector 
one or two decades ago. Please seach www.vector.org.uk if it is available.

Срд, 01 Июн 2011, Ric Tikkanz писал(а):
> I need to interact with some binary files that are basically stored C
> structures.
> Before I attempt to reinvent the wheel, I was wondering if anybody has
> any tools/utilities they are willing to share for reading such files
> an converting them to J arrays?
> I have the declared type structure of the files - for example:
> 
> struct INDIV  {
>     int id;
>     int sireid;
>     int damid;
>     unsigned short breed;
>     unsigned short yob;
>     short inbreed;
>     float brd[4];
> };
> 
> Alternatively I'm also open to advice on how best to approach the task.
> Ric
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to