Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!ncar!ico!ism780c!news From: news@ism780c.isc.com (News system) Newsgroups: comp.lang.c Subject: Re: How do I make my program beep. Keywords: beep Message-ID: <43605@ism780c.isc.com> Date: 7 Jun 90 19:34:29 GMT References: <3472@umn-d-ub.D.UMN.EDU> <1990May27.000808.13551@utzoo.uucp> <1990Jun6.124609.7316@agate.berkeley.edu> <3168@goanna.cs.rmit.oz.au> Reply-To: marv@ism780.UUCP (Marvin Rubenstein) Organization: Interactive Systems Corp., Santa Monica CA Lines: 15 In article <3168@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: >(2) #define mybeep putchar('\7') > has a fairly serious defect: output to stdout is often buffered or > line-buffered, and '\7' is not a complete record. You need > #define mybeep (putchar('\7'), fflush(stdout)) > putchar('\7') has an even more serious defect. The reason for beeping is to notify the user of the program of something while the program is *running*. There is no guarantee that sending a '\7' to stdout will cause an beep. Stdout may well be a diskfile. The output must be directed to a device that will make a noise that the user can hear. I know of no portable way to do this. Marv Rubinstein