Global and Extern Pointers, Arrays

Wayne Throop throopw at sheol.UUCP
Mon May 27 11:53:29 AEST 1991


> dhesi%cirrusl at oliveb.ATC.olivetti.com (Rahul Dhesi)
> [...] char *A and char B[NUM]. [...]
> However, B is not a pointer.  It's just treated like one sometimes.  It
> is a SYMBOLIC NAME FOR AN ADDRESS.

This is a bad model for thinking about pointers and arrays, because
it makes things like sizeof anomalous in the model.  It also uses
words in ways incompatible with the way they are used in the standard,
thus perpetuating confusion.

Why not approach it as the orthodox do?

A is a pointer, B is an array.  Arrays are converted to pointer values
when used in expressions where a value is required, which leads the
heterodox to falsely claim that "arrays and pointers are the same thing
in C". 

What's so complicated about this that it need come up so often?
--
Wayne Throop  ...!mcnc!dg-rtp!sheol!throopw



More information about the Comp.lang.c mailing list