Sam Gonza
Sam Gonza

Reputation: 53

How to print / know the memory location of a variable in Julia?

I have an if loop where 5 different numbers are printed, but I want to know how to also print the memory location of the data. for example I print:

0x7ffd4b096f

0x7ffd4a09af

0x7ffd4c096f

being 3 different variables.

Upvotes: 1

Views: 653

Answers (1)

Przemyslaw Szufel
Przemyslaw Szufel

Reputation: 42234

What about using pointer:

julia> x = [1,2,3];

julia> pointer(x)
Ptr{Int64} @0x000000001bb534d0

Upvotes: 3

Related Questions