Path: utzoo!attcan!uunet!husc6!bloom-beacon!apple!rutgers!gatech!ukma!psuvm.bitnet!cunyvm!nyser!itsgw!imagine!rpics!kyriazis From: kyriazis@rpics (George Kyriazis) Newsgroups: comp.lang.c Subject: Re: string assignment in C Message-ID: <1414@imagine.PAWL.RPI.EDU> Date: 13 Oct 88 14:36:23 GMT References: <1988Oct11.143728.28627@gpu.utcs.toronto.edu> <6777@chinet.chi.il.us> Sender: news@imagine.PAWL.RPI.EDU Reply-To: kyriazis@turing.cs.rpi.edu (George Kyriazis) Organization: RPI CS Dept. Lines: 22 In article <6777@chinet.chi.il.us> john@chinet.chi.il.us (John Mundt) writes: > ... stuff deleted ... >Each string, >"first" and " is:" are reserved by the compiler as unnamed strings >somewhere in memory. ...... My question is: Are strings like " is:" volatile or not? When you say p2 = " is:", are you sure that the string will remain in memory or the optimizer will decide to put something else there since the string is basically a constant used only once?? I also have the idea that if you say p1 = "abc"; p2 = "abc"; p1 and p2 will have different value, since the strings are not the same (they have the same contents, but physically should be different). Is that a right assumption? George Kyriazis kyriazis@turing.cs.rpi.edu ------------------------------