Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Arrays/Oberon-2/arrays.oberon
Normal file
36
Task/Arrays/Oberon-2/arrays.oberon
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
MODULE Arrays;
|
||||
IMPORT
|
||||
Out;
|
||||
|
||||
PROCEDURE Static;
|
||||
VAR
|
||||
x: ARRAY 5 OF LONGINT;
|
||||
BEGIN
|
||||
x[0] := 10;
|
||||
x[1] := 11;
|
||||
x[2] := 12;
|
||||
x[3] := 13;
|
||||
x[4] := x[0];
|
||||
|
||||
Out.String("Static at 4: ");Out.LongInt(x[4],0);Out.Ln;
|
||||
END Static;
|
||||
|
||||
PROCEDURE Dynamic;
|
||||
VAR
|
||||
x: POINTER TO ARRAY OF LONGINT;
|
||||
BEGIN
|
||||
NEW(x,5);
|
||||
|
||||
x[0] := 10;
|
||||
x[1] := 11;
|
||||
x[2] := 12;
|
||||
x[3] := 13;
|
||||
x[4] := x[0];
|
||||
|
||||
Out.String("Dynamic at 4: ");Out.LongInt(x[4],0);Out.Ln;
|
||||
END Dynamic;
|
||||
|
||||
BEGIN
|
||||
Static;
|
||||
Dynamic
|
||||
END Arrays.
|
||||
Loading…
Add table
Add a link
Reference in a new issue