Address of a variable: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (→IWBASIC: fix header markup) |
(Add Zig) |
||
Line 2,140: | Line 2,140: | ||
ld (foo),de ;store E into &C000 and D into &C001 |
ld (foo),de ;store E into &C000 and D into &C001 |
||
ld (bar),bc ;store C into &C001 and B into &C002</lang> |
ld (bar),bc ;store C into &C001 and B into &C002</lang> |
||
=={{header|Zig}}== |
|||
<lang zig>const std = @import("std"); |
|||
pub fn main() !void { |
|||
const stdout = std.io.getStdOut().writer(); |
|||
var i: i32 = undefined; |
|||
var address_of_i: *i32 = &i; |
|||
try stdout.print("{x}\n", .{@ptrToInt(address_of_i)}); |
|||
}</lang> |
|||
{{omit from|8th|Impossible to access address of a variable}} |
{{omit from|8th|Impossible to access address of a variable}} |