converting a byte array to a struct array?

Trass3r mrmocool at gmx.de
Tue Dec 29 07:03:50 PST 2009


Steven Schveighoffer schrieb:
> What is RGB's structure?
> 
> I would expect something like this to work:
> 
> RGB[256] PALETTE = [
> {0x00, 0x00, 0x00},
> {0xE3, 0x53, 0x00},
> ...
> ];
> 
> Assuming RGB is a struct of 3 ubyte members...
> 

Yeah, simply 3 ubytes.
But IIRC I read that struct literals will be removed in D2 so I didn't 
test that approach.


More information about the Digitalmars-d-learn mailing list