From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Is this a bug ??? or feature ?? Date: Tue, 14 Oct 1997 19:49:50 +0000 Organization: Two pounds of chaos and a pinch of salt Lines: 23 Message-ID: <3443CCDE.4557@cs.com> References: <19971013092045 DOT 160 DOT rocketmail AT send1 DOT rocketmail DOT com> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp237.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Guan Foo Wah wrote: > > Can anyone please tell me how to make those three variables not to > share > the same memory location ?? This is important in my project which I am > currently working on. I should add to what's already been posted that string constants should not generally be modified. I don't know if this is ANSI or not, but it's definitely unwise, due to exactly what you've encountered: different compilers optimize string constants in different ways. Well-written code should never attempt to overwrite them unless there's some desperately overriding need. -- --------------------------------------------------------------------- | John M. Aldrich | "Always listen to experts. They'll | | aka Fighteer I | tell you what can't be done, and why.| | mailto:fighteer AT cs DOT com | Then do it." | | http://www.cs.com/fighteer | - Lazarus Long | ---------------------------------------------------------------------