Jump to content

Address of a variable: Difference between revisions

m
→‎{{header|Zig}}: update @ptrToInt() to @intFromPtr() for Zig 0.11.0
imported>Acediast
(→‎{{header|COBOL}}: syntax highlighting doesn't support freeform 🗿)
m (→‎{{header|Zig}}: update @ptrToInt() to @intFromPtr() for Zig 0.11.0)
Line 2,421:
 
=={{header|Zig}}==
{{works with|Zig|0.11.0}}
<syntaxhighlight lang="zig">const std = @import("std");
 
pub fn main() !void {
const stdout = std.io.getStdOut().writer();
Line 2,428 ⟶ 2,429:
var address_of_i: *i32 = &i;
 
try stdout.print("{x}\n", .{@ptrToIntintFromPtr(address_of_i)});
}</syntaxhighlight>
 
59

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.