Link to home
Start Free TrialLog in
Avatar of scrapdog
scrapdogFlag for United States of America

asked on

Accessing memory explicitly

[Note: I am using Delphi 2.0]

If XPtr and YPtr are pointer variables and Offset is an integer/word/longint/etc., is it legal to do the following?

XPtr := YPtr + Offset;

(in case you're curious, in my application XPtr is a pointer to a bitmap and I want to get the memory location Offset bytes from the beginning)

In Delphi 2, I noticed that the seg and ofs functions are obsolete.

I have not tried compiling the unit that uses the XPtr := YPtr + Offset yet, but I assume it is legal.  If it is, would someone confirm this, and if it is not, please tell me how to do it.  Thanks.




ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial