sp****@gmail.com said:
Is the memory argv points to writable ? In other words
is it ok if the programme contains
argv[i] = pointer_to_char where i<argc ?
Same question for *argv[i] = some_char
argv itself is a local object, so you can do this if you like:
argv = newval;
and the runtime system won't even notice.
argv[0] through argv[argc] must not be changed. (This gives implementations
a certain amount of flexibility - for example, it gives them the freedom to
set up the storage for the strings via malloc if they choose, knowing they
can free them again at the end.)
For each argv[n] where n >= 0 && n < argc, you can write to the characters
starting with argv[n][0] and going no further than the null terminator.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)