peterworth
Programmer
is it possible to manually increment a pointer to get the next element in memory? if so, how much should it be incremented by to get the next integer in a series of integers in memory?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
var
i: integer;
ints: array [ 0.. 15 ] of integer;
ip: ^integer; // Pointer to an integer
begin
// Fill array with predictable numbers
for i := Low(ints) to High(ints) do
ints[i] := i + 100;
ip := @ints; // Point to first array element
ShowMessage ( IntToStr ( ip^ ) );
inc ( ip, sizeof(integer) ); // Point to next element
ShowMessage ( IntToStr ( ip^ ) );
end;