I'm translating codes from C++ source code to delphi language. There is a partition allocated to memory in C++ source code and when I allocate the same partition in delphi I get an error. Where am I doing wrong? I've used getmem, setlength and all the others.
C++ code (work) :
int main()
{
char* data = reinterpret_cast<char*>(malloc(938278912));
data[938278911]='m';
printf ("%c \n",data[938278911]);
return 0;
}
Delphi code (not work):
procedure TMainForm.UnpackButton1Click(Sender: TObject);
var
tmpbuf : Pointer;
begin
GetMem(tmpbuf,938278912);
end
Where am i doing wrong ?