static array casting
Jarrett Billingsley
kb3ctd2 at yahoo.com
Thu Mar 27 15:16:33 PDT 2008
"Hoenir" <mrmocool at gmx.de> wrote in message
news:fsgsed$18s3$1 at digitalmars.com...
> Why does
>
> RGBA[] PALETTE = cast(RGBA[]) [
> 0x00, 0x00, 0x00, 0x00, 0xE3, 0x53, 0x00, 0x00,...... ];
>
> work, but
>
> RGBA[256] PALETTE = cast(RGBA[256]) [
> 0x00, 0x00, 0x00, 0x00, 0xE3, 0x53, 0x00, 0x00,...];
>
> doesn't?
> RGBA simply is a struct containing r,g,b and a as ubytes.
Works for me. Are you sure you have exactly 1024 values in that array?
More information about the Digitalmars-d-learn
mailing list