How do I make my program beep.

simon ewins simon.ewins at f664.n250.z1.fidonet.org
Sun Jun 10 11:20:00 AEST 1990


> In article <3168 at goanna.cs.rmit.oz.au> ok at 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.
 
 
How about...
 cprintf("\a");
or
 fprintf(stderr,"\a");
 
. 

--- D'Bridge 1.30/002506
 * Origin: A_X_A_X_A  [ FactBase/qDos <> 416-483-2821 ] (1:250/664)



More information about the Comp.lang.c mailing list