Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!mit-eddie!rutgers!mcnc!rti!mozart!walker From: walker@unx.sas.com (Doug Walker) Newsgroups: comp.sys.amiga Subject: Re: SAS/C - getchar() Message-ID: <1990Sep12.181202.15908@unx.sas.com> Date: 12 Sep 90 18:12:02 GMT References: <90250.211833TEW105@psuvm.psu.edu> Organization: SAS Institute Inc. Lines: 32 In article <90250.211833TEW105@psuvm.psu.edu> TEW105@psuvm.psu.edu writes: >include# (or whatever the standard one is> > >main >{ > char showall; > > printf ("Show all output (y/n)? \n"); > showall=getchar(); > > blah... blah.. blah.. > >} Try using fgets() instead of getchar(). It gets a whole line from input, terminated by a newline character. char buffer[100]; fgets(buffer, 100, stdin); if(buffer[0] == 'y' || buffer[0] == 'Y') showall = 1; else showall = 0; blah... blah... blah... ***** =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 = *|. o.| || | o |// For all you do, this bug's for you! ====== usenet: ...mcnc!rti!sas!walker plink: dwalker bix: djwalker