-
-
Save bgraf/8d241d344b33a7901029ca87a5d2e9fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = [_]u32{ 1, 2, 3, 4, 5 }; | |
var x2: []u32 = &x; | |
var ptr = &x2; | |
std.log.warn("{}", .{@typeName(@TypeOf(ptr))}); | |
std.log.warn("len = {}", .{ptr.len}); | |
var ptr2 = @ptrCast(*c_void, ptr); | |
std.log.warn("{}", .{@typeName(@TypeOf(ptr2))}); | |
var ptr3 = @ptrCast(*[]u32, ptr2); | |
std.log.warn("{}", .{@typeName(@TypeOf(ptr3))}); | |
std.log.warn("len = {}", .{ptr3.len}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment