Address of a variable: Difference between revisions
m
→{{header|M2000 Interpreter}}
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
checkref(&z)
sub checkref(&p)
print VarPtr(z)=VarPtr(p)
end sub
}
checkVarptr
Line 1,261 ⟶ 1,265:
{{out}}
<pre>
True
True
True
|