Difference between "char *arr" and "char arr[]"
Erik Naggum
enag at ifi.uio.no
Wed Oct 3 10:35:37 AEST 1990
In article <7920 at scolex.sco.COM> seanf at sco.COM (Sean Fagan) writes:
In article <ENAG.90Sep25005953 at hild.ifi.uio.no> enag at ifi.uio.no (Erik Naggum) writes:
>Rather, "char arr[14]" declares an array, but "extern char arr[]" only
>declares that "arr" is some constant pointer the value of which is to
>be resolved by the linker.
*NO NO NO NO*!
'extern char arr[]' does *not* declare, in any way, shape, or form, a
pointer.
I'm sorry for all the confusion my severely overloaded use of
"constant" has caused. I have been corrected by what seems like all
the ANSI C programmers in the known and not-so-known universe, and
they all point out that we have a "char * const ptr" construct, which
I have always thought was a horrible abomination, and thus totally
forgot that people could think I meant.
Other than this unfortunate choice of words, we all agree. Relax,
all. My mailbox is off limits, already.
Next time I want to overload, I'll post to comp.lang.c++.
--
[Erik Naggum] Naggum Software; Gaustadalleen 21; 0371 OSLO; NORWAY
I disclaim, <erik at naggum.uu.no>, <enag at ifi.uio.no>
therefore I post. +47-295-8622, +47-256-7822, (fax) +47-260-4427
More information about the Comp.lang.c
mailing list