What a great little learning project.

My suggestion is to work out a simpler version of what you are trying to do:

typedef struct {
    unsigned short rec_type;
    long data;
} type1;

typedef struct {
    unsigned short rec_type;
    char data[4];
} type2;

.....
some_type *chunk_of_mem;

long a = ((type1 *) chunk_of_mem)->data;
char *b = ((type2 *) chunk_of_mem)->data;
.....

and either work out how to get the union syntax or casting.  Both
should work equally well.  One may be easier to work though with you
compiler.

Rob.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/i2pcab1c5a71004131635m4e41c2d6l495894c852a3a...@mail.gmail.com

Reply via email to