Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!mit-eddie!mit-amt!adamk From: adamk@mit-amt.MEDIA.MIT.EDU (Adam Kao) Newsgroups: comp.lang.c Subject: Do string constants persist out of scope? Message-ID: <1380@mit-amt.MEDIA.MIT.EDU> Date: 11 Jan 90 17:02:17 GMT Reply-To: adamk@media-lab.media.mit.edu.UUCP (Adam Kao) Organization: MIT Media Lab, Cambridge MA Lines: 11 If I define a string constant in a procedure and then pass it back out, does the pointer I get remain valid? I'm confused because strings are really char pointers. I tried it in a test program and it worked, but I'm a little worried it might be accidental. I guess what I'm really asking is whether the compiler permanently allocates memory for all the string constants in the whole program. Thanks in advance, Adam