This is a code syntax issue that one of my team members has not been able to resolve and I'm stuck too.
We pass a pointer to an array as one of the parameters of a method and wish to access the individual elements of the said array within the function. This parameter will point to arrays of different lengths.
This is an example of the method :=
Code: Select all
const ImageArr: array [15] of byte = (0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, 0x80, 0xC0, 0xE0);
USAGE : DoSomethingHere(@ImageArr);
procedure DoSomethingHere(const AnArray: ^byte);
var
p: ^byte;
begin
//value of ImageArr[10] is 0xE0, how to access value of nth element of ImageArr,
p^ := AnArray^;
p := p + 10; //this does not point to ImageArr[10]
end;