RosettaCodeData/Task/Multiple-distinct-objects/XPL0/multiple-distinct-objects.xpl0

8 lines
328 B
Plaintext

code Reserve=3, IntIn=10;
char A; int N, I;
[N:= IntIn(8); \get number of items from command line
A:= Reserve(N); \create array of N bytes
for I:= 0 to N-1 do A(I):= I*3; \initialize items with different values
for I:= 0 to N-1 do A:= I*3; \error: "references to the same mutable object"
]