Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!gem.mps.ohio-state.edu!rpi!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: How Does 'C' Store Strings ? Message-ID: <1034@crdos1.crd.ge.COM> Date: 12 Oct 89 15:21:45 GMT References: <2141@avsd.UUCP> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: GE Corp R&D Center Lines: 29 In article <2141@avsd.UUCP>, childers@avsd.UUCP (Richard Childers) writes: | As far as I know, in UNIX, char is stored as individual allocated bytes, | perfectly accessible, perfectly in accord with ASCII specifications. | | I've tried explicitly defining char arrays, IE | | #define vers[CMDBUFSIZ] = "v1.00 891010 richard childers" ; | | ... as well as trying to find strings built into fprintf() calls, to no | avail. What am I missing ? You may have two problems here. One is that something defined to the preprocessor via #define never makes it into the program unless you use it. One way to define your string is to do something like: char *my_id = "The string you want, like copyright"; I make mine static, but I think it would be legal for a compiler to optimize out an unreferenced static. If you can't find strings which are formats of printfs you may have a broken "strings." I have used the one I have and it works for MSC and TC at least. -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "The world is filled with fools. They blindly follow their so-called 'reason' in the face of the church and common sense. Any fool can see that the world is flat!" - anon