Speaking of ksh

Root Boy Jim rbj at icst-cmr.arpa
Thu Jun 9 02:29:18 AEST 1988


   From: Doug Gwyn  <gwyn at brl-smoke.arpa>

   In article <3870001 at hpcuhb.HP.COM> kluft at hpcuhb.HP.COM (Ian Kluft) writes:
   >I've seen malloc() bomb many times on an AT&T 3B5 at CSU Chico when people
   >used char [] and char * interchangeably across function calls.  These have
   >been considered equivalent in all the C texts way back to K&R but, in reality,
   >at least AT&T's C compiler cannot always swallow it.

   Wait a doggone minute.  An array has NEVER been equivalent to a pointer.
   The NAME of an array, when used in an expression, is (in MOST cases, but
   not all) converted to a pointer to its initial member.

Really. Given char *foo; and char bar[] = "something";, foo is a *variable*
while bar is a *constant*. Take two chapters of K&R and don't call me
in the morning.

	(Root Boy) Jim Cottrell	<rbj at icst-cmr.arpa>
	National Bureau of Standards
	Flamer's Hotline: (301) 975-5688
	The opinions expressed are solely my own
	and do not reflect NBS policy or agreement
	My name is in /usr/dict/words. Is yours?



More information about the Comp.unix.wizards mailing list