Address of a variable: Difference between revisions
Content added Content deleted
Deadmarshal (talk | contribs) m (→{{header|Oberon-2}}: Added syntax highlighting) |
|||
Line 1,356: | Line 1,356: | ||
=={{header|Oberon-2}}== |
=={{header|Oberon-2}}== |
||
===Get Address=== |
===Get Address=== |
||
<syntaxhighlight lang="oberon2"> |
|||
<pre> |
|||
VAR a: LONGINT; |
VAR a: LONGINT; |
||
VAR b: INTEGER; |
VAR b: INTEGER; |
||
Line 1,362: | Line 1,362: | ||
b := 10; |
b := 10; |
||
a := SYSTEM.ADR(b); (* Sets variable a to the address of variable b *) |
a := SYSTEM.ADR(b); (* Sets variable a to the address of variable b *) |
||
</syntaxhighlight> |
|||
</pre> |
|||
===Set Address=== |
===Set Address=== |
||
<syntaxhighlight lang="oberon2"> |
|||
<pre> |
|||
SYSTEM.PUT(a, b); (* Sets the address of b to the address of a *) |
SYSTEM.PUT(a, b); (* Sets the address of b to the address of a *) |
||
</syntaxhighlight> |
|||
</pre> |
|||
=={{header|OCaml}}== |
=={{header|OCaml}}== |