Using Pointer to access to a 2D array - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Using Pointer to access to a 2D array

hadipardishadipardis Posts: 134Member
Hi, Please consider the following code:
[code]
var x,y:integer;
M:array of array of byte;
begin

for y:=0 to 640 do
for x:=0 to 640 do
begin
M[x,y]:= Data;
end;
[/code]
Now I want to access the M's elements by pointer in order to speed up the whole process. How can I do so?

Comments

  • zibadianzibadian Posts: 6,349Member
    : Hi, Please consider the following code:
    : [code]
    : var x,y:integer;
    : M:array of array of byte;
    : begin
    :
    : for y:=0 to 640 do
    : for x:=0 to 640 do
    : begin
    : M[x,y]:= Data;
    : end;
    : [/code]
    : Now I want to access the M's elements by pointer in order to speed up the whole process. How can I do so?
    :
    You can use the @-operator.
Sign In or Register to comment.