Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!mp.cs.niu.edu!ux1.cso.uiuc.edu!phil From: phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN) Newsgroups: comp.lang.c Subject: Re: returning automatic variables Keywords: automatic variables, returning values Message-ID: <1991May25.012123.23480@ux1.cso.uiuc.edu> Date: 25 May 91 01:21:23 GMT References: <1991May24.153133.13590@ux1.cso.uiuc.edu> Organization: University of Illinois at Urbana Lines: 16 nnj20229@uxa.cso.uiuc.edu (Nesha Nicole Jones) writes: >I wrote the following simple program and when it runs I get the following >output. Is it possible to return an automatic string form a function >because I cannot get it to work. No. Either allocate a string (and be sure to free it) or use static. In the case of static, the contents of the string will change the next time your function is used. BTW, what if I type in more than 99 characters into your string? -- /***************************************************************************\ / Phil Howard -- KA9WGN -- phil@ux1.cso.uiuc.edu | Guns don't aim guns at \ \ Lietuva laisva -- Brivu Latviju -- Eesti vabaks | people; CRIMINALS do!! / \***************************************************************************/