Global and Extern Pointers, Arrays

Doug Gwyn gwyn at smoke.brl.mil
Fri May 24 05:54:06 AEST 1991


In article <AJ3U.91May22202642 at agate.cs.virginia.edu> aj3u at agate.cs.virginia.edu (Asim Jalis) writes:
>file.1
>	struct x px[1] = { ... };
>file.2
>	extern *px	/* boinks */
>	extern px[]	/* works */
>Any ideas as to why this is?

Sure, but the question is, why would you think it ought to work the
other way, where there is a clear type mismatch?  The only thing I
can think of is that somehow you have gotten the notion that arrays
and pointers are the same thing; that is false, and you should learn
what the difference is and why under SOME circumstances the two types
"seem" to act the same.  I'm sure this information is widely available,
probably in the FAQ list.



More information about the Comp.lang.c mailing list