Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Is it OK to modify argv ???
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Larry__Weiss, post: 1676568"] Strange that you can modify the strings, considering that they may in fact be null strings. How can you modify a null string? I would have found it more reasonable that you would have to leave the original strings alone, but have the freedom to allocate and substitute different strings in the argv array, or in fact allocate a new argv structure and change argv to point to the new one. On rereading the Standard (from 5.1.2.2.1 Program startup) 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. I can imagine that that means my alternative interpretation without too much stretch. It might mean not that the content of the original strings are modifiable, but that the strings themselves can be substituted for other strings. Where are the examples? The Standard should be overflowing with examples of code that reinforce what the prose text says. - Larry Weiss [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Is it OK to modify argv ???
Top