Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!virtech!cpcahil From: cpcahil@virtech.UUCP (Conor P. Cahill) Newsgroups: comp.lang.c Subject: Re: Help... Message-ID: <1253@virtech.UUCP> Date: 10 Oct 89 11:50:25 GMT References: <731@carroll1.UUCP> Organization: Virtual Technologies Inc Lines: 19 In article <731@carroll1.UUCP>, dnewton@carroll1.UUCP (Dave 'Yes, I'm weird' Newton) writes: > main () > { > char h[]; ^^ You need to specify the size of the array. Otherwise your scanf will overwrite other data on the stack and usualy will cause a core dump. > scanf ("%s", h); > printf ("%s\n", h); > } -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+