Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: writing a c program to substitute text Date: Mon, 27 Feb 2017 09:56:18 -0800 Organization: None to speak of Lines: 24 Message-ID: References: <2c574151-71a0-4bcf-a904-50a13eaf81b0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="704c5d663da9e0150365451e4cbc43e2"; logging-data="30365"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+chDIthZzr18tqfsdL6arI" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:5jbyZgzcptC+zblaABgNYWAh1/I= sha1:YudlD0g+gQccf9iIRKpwIur7Nic= Xref: csiph.com comp.lang.c:104899 Malcolm McLean writes: > On Monday, February 27, 2017 at 12:41:24 PM UTC, fred flintstone wrote: >> On 02/26/2017 06:42 AM, Malcolm McLean wrote: >> Thanks, malcolm. The way I have it now, I have the strings to be >> substituted initialized in source code: >> >> const char *executable1 = "arrow"; >> const char *executable2 = "mahershala"; >> >> How would the memory considerations go if these were to come off the >> command line with argv[]? >> > argv[] strings are writeable, but it's a bad idea to write to them. I don't believe anyone suggested writing to the argument strings, nor would there be any reason to do so here. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"