I have multidimensional array:
TBMArray = TArray<array of byte>;
And recursive function
function goForSolve(bData: TBMArray; const iSize: integer): TBMArray;
At this function i have
tempData: TBMArray;
I need to change tempData without changing the value of bData. But when i change tempData, bData also changes. I tried to copy bData to tempData by function
procedure copyData(Source: TBMArray; var Dest: TBMArray);
var
iCurEl, iLen: integer;
begin
iLen := length(Source);
setLength(Dest, iLen);
setLength(Dest[0], 1);
for iCurEl := 1 to iLen - 1 do
setLength(Dest[iCurEl], iCurEl + 1);
for iCurEl := Low(Source) to High(Source) do
Dest[iCurEl] := Source[iCurEl];
end;
But result is the same as
tempData := bData;
It seems like function copy pointers instead of values.