Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSwiftunsafeBitCast and pointersSingle-choice MCQ

What does this program print, and what does it reveal about how `unsafeBitCast` interacts with little-endian memory layout?

var pair: (UInt32, UInt32) = (0x11223344, 0xAABBCCDD) let combined = withUnsafePointer(to: &pair) { $0.withMemoryRebound(to: UInt64.self, capacity: 1) { $0.pointee } } print(String(combined, radix: 16))