Jump to content

Address of a variable: Difference between revisions

m
Line 1,243:
From version 12, VarPtr() can return address for variables and array items.
 
We can't set an address to a variable. We can link a variable name with an existing variable. Is the same as passing by reference.
 
<syntaxhighlight lang="m2000 interpreter">
Line 1,255:
print k(1,0,1)=x
link z to m
Printprint VarPtr(z)=VarPtr(m)
checkref(&z)
sub checkref(&p)
print VarPtr(z)=VarPtr(p)
end sub
}
checkVarptr
Line 1,261 ⟶ 1,265:
{{out}}
<pre>
True
True
True
404

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.