On 9 Mar 2006 03:21:21 -0800, "WaterWalk" <toolmaster@163.com> wrote:
[color=blue]
> Hi. Today when I was writing some code fragment, I suddently noticed
> that string literals are usually not modifiable. But why can it be
> assigned to a variable of type "char *"? I searched the comp.lan.c faq,
> and found the answer in Q1.32(
http://c-faq.com/decl/strlitinit.html).
>
> I want to learn more about this subject, then I checked the references,
> among which is "ISO Sec. 6.1.4, Sec. 6.5.7 ". I downloaded n1124(C99
> with TC1, TC2 draft). But I can't find such topics as the type of
> string literal in those sections. Where are they then? Thanks for your
> help.[/color]
The references in the FAQ were (AFAIK all) to C90. C99 added or
promoted several sections, resulting in following ones being
renumbered. Former 6.1.4 is now 6.4.5 (String literals) and 6.5.7 is
now 6.7.8 (Initialization, particularly of char[n] by "string").
And its references to Rationale were to the ANSI version, C89, whose
numbering (only) differs from C90, for which JTC1 did not release a
rationale. Since at least 1999 WG14 has been making public at least
some draft Rationales (I don't think they ever approved one as final),
which (now) use the ISO and specifically C99 numbering.
- David.Thompson1 at worldnet.att.net