Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSwiftmemory layout and alignmentSingle-choice MCQ

Given this struct, what is its `MemoryLayout.size`, `.stride`, and `.alignment` on a 64-bit platform, and why do size and stride differ?

struct S { var a: Int8 // 1 byte var b: Int64 // 8 bytes var c: Int8 // 1 byte } // MemoryLayout<S>.size, .stride, .alignment = ?