Why dynamic arrays in a struct crash when they are effectively at 8 byte align, but precceeded with align(1)?
realhet
real_het at hotmail.com
Wed Oct 14 12:12:01 UTC 2026
On Wednesday, 14 October 2026 at 12:04:12 UTC, realhet wrote:
> Hi,
So many typos, sorry:
```d
struct WorkorderNode{
align(1):
ThingId thingId;//a 4 bytes long struct
bool opened;
ubyte[3] dummy; //so far 8 bytes
align(8):
WorkorderNode[] subNodes; //align must be >=8 or else this
reads garbage.
}
```
More information about the Digitalmars-d-learn
mailing list