Re: [cc65] Another wish: Unsized Arrays in Structures

Date view Thread view Subject view

From: David Holz (davidh_at_otterspace.com)
Date: 2003-01-23 06:15:59


From: "Christian Krüger" <christian.krueger_at_pace.de>
> typedef struct
> {
>   unsigned char width;
>   unsigned char height;
>   unsigned char data[];
> }
> TestStruct;

To do what you want, change the last line of the struct to "unsigned char
data[1];".  Then, when you allocate the struct, do "myStruct =
malloc(sizeof(TestStruct) + dataSize);" to increase the size of "data".

--
White Flame (aka David Holz)
http://www.white-flame.com/


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-01-23 06:13:43 CET