1 messages · Page 1 of 1 (latest)
Try std.mem.readInt(u16, &"ex");
std.mem.readInt(u16, &"ex");
the & is incorrect
&
that would yield a *const *const [2:0]u8
*const *const [2:0]u8
var xy: u16 = @bitCast(@as([2]u8, "ex".*)); should work here
var xy: u16 = @bitCast(@as([2]u8, "ex".*));
Oh, right. I'm still stuggling with strings vs slices of bytes.