This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.
In an older post, we explored Zig's @ptrCast and then looked at a concrete usage in the shape of std.heap.MemoryPool . @ptrCast As a brief recap, when we use @ptrCast , we're telling the compiler to treat a pointer as a given type. For example, this code runs fine: const std = @import("std"); pub fn main() !void { var user = User{.power = 9001, .name = "Goku", .active = true}; const cat: *Cat =…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.