2 ms·
There's a #[repr(C)] annotation that can be placed on a struct, IIRC.
by dezgeg 12y ago
There's a #[repr(C)] annotation that can be placed on a struct, IIRC.
- FreeFull 12y agoThat guarantees the same layout that C would have for that struct. There is also #[repr(packed)] which puts things as close as possible without alignment, and then you can insert padding manually with fields of type [u8; N] where N is the number of bytes.