String help!

VLD/VMB gwyn at Brl-Vld.ARPA
Thu Mar 7 00:56:34 AEST 1985


The latest draft proposed ANSI standard for C supports a "const"
type-modifier, to flag data that may not be modified.  String
literals are (const char) arrays and may not be modified.  It
is possible to initialize a non-const (char) array with a string
if one wants to be able to modify it at run-time.

One significant advantage of (const char) strings is that they
are ROMable.  Another is that storage for identical strings can
be shared if the compiler/loader is sufficiently clever.



More information about the Comp.lang.c mailing list