How do I make my program beep.

P E Smee exspes at gdr.bath.ac.uk
Mon Jun 11 19:14:11 AEST 1990


In article <43605 at ism780c.isc.com> marv at ism780.UUCP (Marvin Rubenstein) writes:
>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.

Only things certain in life are death and taxes.  However, I'd say you
could maximize your changes by writing the '\7' to stderr rather than
stdout; or, even better, to /dev/tty.  With flushes as required.

-- 
Paul Smee, Computing Service, University of Bristol, Bristol BS8 1UD, UK
 P.Smee at bristol.ac.uk - ..!uunet!ukc!bsmail!p.smee - Tel +44 272 303132



More information about the Comp.lang.c mailing list