Mail Archives: djgpp/1995/05/07/18:07:24
On Sun, 7 May 1995, Eli Zaretskii wrote:
> > i'm having an interesting problem. i have the following struct that i am
> > reading in from a file:
> > somehow a byte is getting lost, and it doesn't make much sense. i could
>
> That's because the compiler is free to pad structure fields to make
> memory accesses more efficient. If you want to make the structure
> packed (i.e. that its sizeof will be 13), use the __attribute__((packed))
> extension of GNU C (it's in the docs).
>
Is there an 'easy' pack/unpack conversion ?
IE: I want to 'pack' for space considerations and 'unpack' for speed.
... or ... would I need _two_ different arrays and move bytes between
(slow and defeats any 'gains') ... (No sparse MAT code please ;> ).
RDC AT freenet DOT vancouver DOT bc DOT ca UNIX(r) System V Release 4.0 [142.103.106.2]
http://www.freenet.vancouver.bc.ca incoming:// 49 15 00 N 123 07 00 W
- Raw text -