Consider my sample code:
var p512Sector:PByte; ..... getmem(p512Sector, 262144); FillChar( p512Sector,262144 ,0);
When I run the program, Delphi gives me an access violation error. Why?
Use FillChar(p512Sector^, 262144, 0)(note dereferencing ^). Otherwise, you are rewriting the pointer and material in memory, not a dedicated buffer.
FillChar(p512Sector^, 262144, 0)
FillCharexpects an untyped variable. You must dereference a pointer:
FillChar
FillChar(p512Sector^, ...);
Source: https://habr.com/ru/post/1775143/More articles:How flexible is the array implemented in c? - cPython app for django web application - pythonDownload Java Servlet progress bar? - javaProgress bar to download files? - java(py) cairo - fill in - pythonDifficult Substring Use - substringT-SQL contains search and German Umlaut on SQL Server 2008 R2 - sql-serverjavascript scope - javascriptlibavcodec, как перекодировать видео с разными частотами кадров? - c++How to call an external program from vim with visually labeled text as a parameter? - vimAll Articles