Russell Whitaker wrote:
On Sat, 5 Jul 2003, Peter N Lewis wrote:
var c: CSPtr;
Since c is a pointer where does it point?
begin Inc(CSPtr(c)); end.
If you increment c just where does it point?
It's just an example, a minimal example that generates the error to make it as easy as possible to find the cause. The actual code was in a C String to PString routine and did indeed assign the variable a value first.
A class I took some 20+ years age touched on pointers in pascal and the "proposed standard": given " Var A: ^x; B: ^x;" then A & B are considered to be different types. If the standard in this area has not been changed from the proposed standard then it appears to me that "incompatable types" for the example program is correct.
AFAIK, the standard hasn't changed, but that's not relevant here. In Peter's test program there are no two distinct pointers -- the whole program contains only one `^'. (Besides, pointer arithmetics are non-standard, anyway.)
Frank