Address of a variable: Difference between revisions

m
→‎{{header|Sidef}}: fixed the example
(→‎{{header|Rust}}: Added pointer option for formatting.)
m (→‎{{header|Sidef}}: fixed the example)
Line 1,055:
 
=={{header|Sidef}}==
There is no way to access the address of a variable in Sidef, but you access the address of an object.
<lang ruby>var n = 42;
say Sys.refaddr(\n); # prints the address of the variable
var x =say Sys.refaddr(n); # "x"prints willthe pointaddress atof the same object at which "n"the variable points to</lang>
 
var x = n; # "x" will point at the same object at which "n" points to
say Sys.refaddr(x);</lang>
{{out}}
<pre>
42823224
26411640
37867184
26411640
</pre>
 
2,747

edits