From: Lennart Marien Newsgroups: comp.os.msdos.djgpp Subject: Re: Problems with GCC under Win95!?! Date: Tue, 26 May 1998 20:22:33 +0200 Organization: Metronet Lines: 41 Message-ID: <356B0869.B6518D2@metronet.de> References: <356999D4 DOT 626D8E7E AT metronet DOT de> <356AC1A6 DOT 6AA3EC93 AT cais DOT kaist DOT ac DOT kr> NNTP-Posting-Host: hamburg2.pop.metronet.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Ho-Jin Dan schrieb: > > hmm... another getch question is on air... ^^; > getch is not a ansi member. in other word, is not included in the > gnu library. > i think getch() is useful in many ways. > ok... you can make a getch function such that > > #include > #include > > int getch() { > struct termio o, n; > char c; > > ioctl(0, TCGETA, &o); > ioctl(0, TCGETA, &n); > > n.c_lflag &= ~(ICANON | ECHO); > n.c_cc[VMIN] = 1; > n.c_cc[VTIME]= 0; > > ioctl(0, TCSETA, &n); > while(read(0, &c, 1) <= 0); > ioctl(0, TCSETA, &o); > > return (int)c; > } Sorry, I didnīt really understand your point.:-) The error happens without the getch(); , as well. main(void) { }; Huh!Even *THAT* produces a "general protection fault"! cu