string assignment in C
Doug Gwyn
gwyn at smoke.BRL.MIL
Thu Oct 20 19:58:40 AEST 1988
In article <9710 at haddock.ima.isc.com> karl at haddock.ima.isc.com (Karl Heuer) writes:
-True in K&R C, but fixed in dpANS: "Identical string literals ... need not be
-distinct. If the program attempts to modify a string literal ... the behavior
-is undefined." [3.1.4] "This specification allows implementations to share
-copies of [identical] strings." [R3.1.4]
True. I was thinking of string-literal initialized char arrays,
not pointers to string literals. Sorry.
More information about the Comp.lang.c
mailing list