On Fri, Jul 4, 2014 at 8:46 AM, Branko Čibej <brane_at_wandisco.com> wrote:
> On 04.07.2014 02:14, Gabriela Gibson wrote:
>
> I also looked at the C90 standard because I thought maybe they defined
> argv as immutable (since it should not complain about being const with this
> type of main declaration I think) and this is what is says:
>
> "The parameters argc and argv and the strings pointed to by the argv
> array shall
> be modifiable by the program, and retain their last-stored values
> between program
> startup and program termination."
>
> This seems a bit ambiguous --- so it's changeable, but between start up
> and termination they retain their value?
>
>
> Read your quote again. "they retain the *last-stored* value".
>
>
> <picky>
There is a comma (after the info that they are changeable), and then you
get the info chunk that "and retain their last-stored values between
program startup and program termination" which sets a start and end point
and a condition in the middle.
Since they are not changing at random (or we hope not!) and since we can be
sure that they exist during execution(so the two conditions don't need to
be mentioned especially, since they are a givens), it's reasonable (and
probably wrong) to infer that the authors meant to convey that internally
they can be modified, but externally, they are treated as immutable.
</picky>
TIL that the C90 standard contains a Rohrschachtest %-)
Gabriela
--
Visit my Coding Diary: http://gabriela-gibson.blogspot.com/
Received on 2014-07-04 10:44:26 CEST