From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: Segmentation fault in UNIX Date: Fri, 08 May 1998 08:01:04 -0700 Organization: Alcyone Systems Lines: 20 Message-ID: <35531E30.3E308AEB@alcyone.com> References: <35519D05 DOT 18BA AT cc DOT hut DOT fi> <3553edeb DOT 3391725 AT news DOT Austria DOT EU DOT net> NNTP-Posting-Host: charmaine.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Gerhard Gruber wrote: > No memory allocated for lin and pin. > > before you call gets() you have to have some line like > if((lin = malloc()) == NULL) > { > fprintf(stderr, "not enough memory\n"); > exit(1); > } Or how about just declare them as a static array? -- Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com Alcyone Systems / http://www.alcyone.com/max/ San Jose, California, United States / icbm:+37.20.07/-121.53.38 \ "Even if opponents are numerous, / they can be made not to fight." / Sun Tzu