VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Arithmetic operations on memory address pointers

Rde  (54 Submissions)   Math/Dates   Advanced   Wed 3rd February 2021

Function to enable valid addition and subtraction of unsigned long integers. Treats the passed value as an unsigned long and returns an unsigned long. Allows safe arithmetic operations on memory address pointers. Assumes valid pointer and pointer offset. Rather fast too, has very small performance hit compared to unsafe in-line calculation, even in intensive loops. The code for addition came from VBC (LukeH) but I needed subtraction as well, thought I'd share. Confirmation that this produces valid results would be appreciated.

Rate Arithmetic operations on memory address pointers (4(4 Vote))
Arithmetic operations on memory address pointers.bas

Arithmetic operations on memory address pointers Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters