Path: utzoo!mnetor!uunet!husc6!tut.cis.ohio-state.edu!ut-sally!ghostwheel!ned From: ned@ghostwheel.UUCP (Ned Nowotny) Newsgroups: comp.lang.c Subject: Re: `Extra' newline when using getchar() (was: C Quirk??) Message-ID: <147@ghostwheel.UUCP> Date: 26 Mar 88 00:16:06 GMT References: <1653@ssc-vax.UUCP> <285@sp7040.UUCP> <976@mcgill-vision.UUCP> <596@tuvie> Reply-To: ned@ghostwheel.aca.mcc.com.UUCP (Ned Nowotny) Organization: MCC Database Program, Austin, Texas Lines: 34 In article <596@tuvie> rcvie@tuvie.UUCP (Alcatel-ELIN Forsch.z.) writes: >In article <976@mcgill-vision.UUCP> mouse@mcgill-vision.UUCP (der Mouse) writes: >>> Since it sounds like you are wanting just one character at a time how >>> about considering putting the system in raw mode so that when you do >>> the getchar it comes right back at you. Why wait an force the user >>> to hit a charrage return. >> >>Cbreak mode is probably better than raw mode. Have you ever written a >>program that uses raw mode and then discovered a bug in the handling of >>the command that's supposed to get you out? Great fun, isn't it? >> > >Would all you ignorant UNIX-users out there please recognize that there exist >other operating systems as well that cannot be put into `raw mode', >`cbreak mode' or whatever! C is ***not*** expected to work solely under >UNIX! [More flamage in the same vein deleted.] Rather than flaming away, try giving an operating system independent method of getting getchar() to return a character immediately upon typing the character. When you fail, you might appreciate why people responded with operating system specific solutions. Now, maybe you can come up with an operating system independent replacement for getchar() with conditional compilation for all known systems, but I would be surprised if even then you could succeed in creating a universally portable method of handling character- at-a-time I/O. Discussing C issues independent of operating system is desirable, but some issues (e.g. I/O) are necessarily operating system dependent. If you must flame people for being too system oriented, consider the numerous messages which debate the relative merits of Turbo C vs. Microsoft C. Certainly this is more combustible material. -- Ned Nowotny (ned@ghostwheel.aca.mcc.com.UUCP)