Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const std = @import("std");
- const TwoPointers = struct {
- ptr1: [*]const u8,
- ptr2: [*]const u8,
- };
- pub fn main() void {
- var tpInMain = TwoPointers {.ptr1 = "hello"[0..].ptr, .ptr2 = "a"[0..].ptr + 5};
- std.debug.warn("&tpInMain = {}\n", @ptrToInt(&tpInMain));
- foo(tpInMain);
- }
- fn foo(tpInFoo: TwoPointers) void {
- std.debug.warn("&tpInFoo = {}\n", @ptrToInt(&tpInFoo));
- var tpCopyInFoo = tpInFoo;
- std.debug.warn("&tpCopyInFoo = {}\n", @ptrToInt(&tpCopyInFoo));
- //value += 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement