In C I am able to cast a memory buffer as a struct. This makes parsing extremely easy. How can I do the same in swift?
I have tried utilizing offset(of: ...)
but it doesn't seem to pack the size into the shortest possible size, and I am unaware of a directive that informs swift to pack the memory.
I asked the question of offset(of: ...)
here: Swift offset(of:) for UInt8 has 2 byte offset