Mail Archives: djgpp/1997/10/15/00:15:25
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 |
---------------------------------------------------------------------
- Raw text -