home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!olivea!sgigate!sgiblab!tsoft!dennis
- From: bbs.dennis@tsoft.sf-bay.org (Dennis Yelle)
- Newsgroups: comp.os.os2.programmer
- Subject: getch() + Ctrl-C == locked program
- Message-ID: <uDgLqB2w165w@tsoft.sf-bay.org>
- Date: 4 Sep 92 20:35:29 GMT
- Sender: bbs@tsoft.sf-bay.org (BBS User)
- Organization: The TSoft BBS and Public Access Unix, +1 415 969 8238
- Lines: 36
-
- #if 0
- When I compile this program with:
- icc /B"/st:0x08000" /Sm getch.c
- and run it with:
- getch
- It works OK unless I type a Ctrl-C.
-
- If I type a Ctrl-C the program locks up and ignores all
- other characters, and I can not get rid of the program.
-
- I do not care if getch() returns the control-c to me or not,
- but I do not want it to hang.
-
- Can anyone help me with this problem?
- #endif
-
- #include <conio.h>
- #include <stdio.h>
- #include <stdlib.h>
-
- main( int argc, char **argv)
- {
- int c;
-
- argc = argc;
- argv = argv;
-
- printf( "Please press a key>");
- fflush( stdout);
- c = getch();
- printf( "\n" "thanks for the 0x%02X.\n", c);
- return 0;
- }
-
- --
- Dennis Yelle (bbs.dennis@tsoft.sf-bay.org)
-