[fpc-pascal] Illogical automatic dereferencing

Marco van de Voort marcov at stack.nl
Sat Oct 10 15:11:24 CEST 2009


In our previous episode, Henry Vermaak said:
[ Charset ISO-8859-1 unsupported, converting... ]
> 2009/10/10 J?rgen Hestermann <juergen.hestermann at gmx.de>:
> >
> > It is illogical that I am able to enumerate a pointer as if it was an array.
> > So the brackets do the dereferencing automatically. When I write X[1] it
> > assumes I meant X^[1]. To the user it behaves the same as if X was an array
> > instead of a pointer to an array. There is no difference in syntax which is
> > wrong IMO. It's not wonder that many users think it *is* an array.
> 
> One thing I think you don't understand is that an array _is_ a
> pointer.  Look at this table to visualise:

> http://en.wikipedia.org/wiki/C_syntax#Accessing_elements

That link is talking about interchangability, which is not the same as being
the same.



More information about the fpc-pascal mailing list