"DAGwyn" <> writes:
> The answer to the original question is that of course the elements
> of the array (of length equal to the value of main's int parameter)
> pointed to by main's char** parameter can be modified. If we had
> intended otherwise we would have used const qualification at the
> appropriate position (between the *s) when specifying the interface.
Then why does 5.1.2.2.1p2 explicitly state that the program can modify
argc, argv, and the strings pointed to by the argv array, but not make
the same statement about the elements of the argv array? Was it just
an oversight?
There is precedent (string literals) for making something not
explicitly const, but not allowing it to be modified.
If you're correct, than an implementation that makes argv a pointer to
an array (of char*) in read-only memory (or at least memory that can't
be modified by the program) would be non-conforming, but it's not
quite obvious (to me) from the standard.
And Doug, if you're going to post through Google Groups, please read
<http://cfaj.freeshell.org/google/>. Thanks, and Merry Christmas.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.