Assignment to Pointer-referenced Variable
Posted: Sat Apr 27, 2019 11:06 am
Code: Select all
MODULE M;
TYPE
P = POINTER TO T;
T = RECORD END;
VAR
p: P;
t: T;
BEGIN
p^ := t
END M.
A technical support group for Astrobe Oberon users
https://astrobe.com./forum/
Code: Select all
MODULE M;
TYPE
P = POINTER TO T;
T = RECORD END;
VAR
p: P;
t: T;
BEGIN
p^ := t
END M.
Code: Select all
MODULE M;
IMPORT Main, Out;
TYPE
P = POINTER TO T;
T = RECORD
i: INTEGER
END;
VAR
p: P;
t: T;
BEGIN
t.i := 13;
p^ := t;
Out.Int(p.i, 0); Out.Ln;
p.i := 4;
Out.Int(p.i, 0); Out.Ln
END M.