Quote Originally Posted by imcold
Quote Originally Posted by waran
If you are using Freepascal then you can use any pointer as array (C-Style).
"someWordPtr[20] := 0" -> would access element #19.
SomeWordPtr[20] would access element no. 21.
That depends on what settings you have turned on in FPC.

WILL, take a look at PChar's and PWord's. They are the fastest methods for direct memory addressing. Same as in C/C++ you can quickly inc and dec them as well as De-reference them for direct access. You can also do things such as (p+N)^ to access the Nth item (just remember that you will always be looking at N+1).

Final note, PChar's and PWord's take less overhead then dynamic arrays but they do require that you alloc the block up front. Dynamic arrays take longer to access if your talking about Bytes or Words in comparison, but they do offer an easy way of resizing your structure if necessary.