swap static array |
Smart pascal source code
var r1 = [1]; var r2 = [2]; WriteLn(r1[0]); WriteLn(r2[0]); Swap(r1, r2); WriteLn(r1[0]); WriteLn(r2[0]); var z1: array [1 .. 2] of Integer = [10, 2]; var z2: array [1 .. 2] of Integer = [30, 4]; WriteLn(z1[1] + z1[2]); WriteLn(z2[1] + z2[2]); Swap(z1, z2); WriteLn(z1[1] + z1[2]); WriteLn(z2[1] + z2[2]); {<<< RESULT - CONSOLE LOG >>> ----------------------------- 12 21 1234 3412 ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}