I have two different variables defined as
^Byte as in:
var P1 : ^Byte; P2 : ^Byte;
Yet when I I try:
it says Type mismatch yet I can do:
Coming from C, I don't get it? Wouldn't
P2 be the value of the pointer and when you want to access what it points to you would use
P2^ and if you use
@P2 you are getting the address to the pointer variable itself?
What am I missing?
Afaik in classic (70's) standard pascal this should work. But Turbo Pascal adn Delphi and derivatives went a different route, and consider both ^byte's declaration of new separate types.
Solution: declare pbyte = ^byte; and use pbyte everywhere. If you are using a recent Delphi or Free Pascal, pbyte is already predefined or in unit types.