# Question regarding address and pointer

**URL:** <https://ziggit.dev/t/question-regarding-address-and-pointer/913>\
**Category:** Help\
**Tags:** memory-management\
**Created:** [June 26, 2023, 6:59am UTC](https://ziggit.dev/t/question-regarding-address-and-pointer/913 "2023-06-26T06:59:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![AndrewCodeDev](https://ziggit.dev/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@AndrewCodeDev](https://ziggit.dev/u/AndrewCodeDev)\
**Post date:** [June 26, 2023, 7:55am UTC](https://ziggit.dev/t/question-regarding-address-and-pointer/913/2 "2023-06-26T07:55:10Z")

</div>

I’m curious if you have tried other built-ins, such as @intFromPtr?

The documentation isn’t as clear as I’d like it to be, but it may be worth checking out:

```zig
@intFromPtr:

Converts value to a usize which is the address of the pointer. value can be *T or ?*T.

To convert the other way, use @ptrFromInt

```

I’m running this code here:

```zig
var return_value: [2]i32 = [_]i32{0} ** 2;

const print = @import("std").debug.print;

pub fn main() !void 
{
    const p1: *i32 = &return_value[0];

    const p2: *[2]i32 = &return_value;

    print("\n\n{any}\n\n{any}\n\n", .{@intCast(i32, @intFromPtr(p1)), @intCast(i32, @intFromPtr(p2))});
}

```

And here is what it produces:

```zig
2416648

2416648

```

Just a note - here in, @intCast is changing so that the first argument will not be necessary: [Major zig language update just landed: removal of destination type from all cast builtins - #4 by AndrewCodeDev](https://ziggit.dev/t/major-zig-language-update-just-landed-removal-of-destination-type-from-all-cast-builtins/898/4)

---

_[View the full topic](https://ziggit.dev/t/question-regarding-address-and-pointer/913)._
