Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!dog.ee.lbl.gov!nosc!humu!pilikia!art From: art@pilikia.pegasus.com (Art Neilson) Newsgroups: comp.lang.c Subject: Re: Is this ok?? Message-ID: <1991Mar09.092611.24821@pilikia.pegasus.com> Date: 9 Mar 91 09:26:11 GMT References: Distribution: comp Organization: Pilikia, Honolulu Lines: 23 In article davis@pacific.mps.ohio-state.edu (John E. Davis) writes: >Hi, > > The following code works on sun4 and ultrix but crashes on VMS. Just when >I thought I understood pointers..... After seeing lots of replies to John Davis I went back and examined the program he posted again and realized I was wrong regarding his pointer usage, I sorta jumped the gun when I saw the &'s and ** stuff, I was wrong. I still don't think it's OK to assign the quoted string "Hello\n" to *s in fm2() as shown below. Where does *s point to ? Where in storage would "Hello\n" reside ? Does the compiler assign some scratch storage or something for it ?? >#include >void fm2(s) >char **s; >{ > *s = "Hello\n"; >} -- Arthur W. Neilson III | INET: art@pilikia.pegasus.com Bank of Hawaii Tech Support | UUCP: uunet!ucsd!nosc!pilikia!art