Mail Archives: djgpp/1997/10/14/04:57:00
---Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
> On Mon, 13 Oct 1997, Guan Foo Wah wrote:
> > This time, num, and id share the same memory location.
> > 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
> > currently working on.
> Somebody already posted the gcc switch to do that. But I would like
> point out that what you are doing is non-portable. Some compilers
> let you write into constant strings at all, others would result in
> bugs. The reason is that some compilers put constant strings into
> read-only data, where you cannot change anything at run time.
> The right thing to do is to copy the strings into automatic arrays
> strcpy etc.) and then manipulate them as you see fit.
Please tell me the switch to to that. Portability is not an issue.
Sent by RocketMail. Get your free e-mail at http://www.rocketmail.com
- Raw text -