Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sun-barr!rutgers!att!westmark!mole-end!mat From: mat@mole-end.UUCP (Mark A Terribile) Newsgroups: comp.lang.c Subject: Re: String assignments; Was: When is a cast not a cast? Summary: "... and the storage class >static<" Message-ID: <164@mole-end.UUCP> Date: 4 May 89 07:22:10 GMT References: <2747@buengc.BU.EDU> <13721@steinmetz.ge.com> <1814@leah.Albany.Edu> Organization: mole-end--private system. admin: mole-end!newtnews Lines: 17 > > | 7 c = "somestring"; /* Nothing fancy, null-terminated. */ > Now I always thought this kind of thing was extremely bad form, ... But what > if the compiler decides that ``somestring'' has finished its duty to the > program, and overwrites the space it took with something else? ... > Have I been misguided all this time? Both K&R-I and K&R-II, in the appendices, under the heading ``String Constants'', declare that a string has the storage class static , which means that the lifetime of the object is the lifetime of the program. -- (This man's opinions are his own.) From mole-end Mark Terribile