extern declaration inconsistency

Robert Virding robert at erix.UUCP
Sat Apr 7 05:24:13 AEST 1984


This is one instance when a pointer is not the same as an array. When the
compiler sees

extern char *ch;

it assumes that ch is a pointer to a string of char. However when the
compiler sees

extern char ch[];

it assumes that ch IS the actual string, not a pointer. The difference in
the code generated is how it actually references the external variable ch.

I have also come across this feature in writing programs.

			Robert Virding  @ L M Ericsson, Stockholm



More information about the Comp.lang.c mailing list