On Fri, 25 Dec 2009 18:58:26 +0000, Anton Shterenlikht <me...@bristol.ac.uk> 
wrote:
> How can I get a beep from c?
> I looked at curses and syscons.c, but
> still not clear.

If you want to use NCURSES / CURSES, it's a bit complicated.

Otherwise, just output %c (the character) 0x07, BEL, which
generates an audible bell, or beep.


*** text/plain attachement has been stripped *** RETRY ***

/* beepflash.c
 * -----------
 * cc -Wall -lcurses -o beepflash beepflash.c
 *
 */

#include <stdio.h>
#include <ncurses.h>

int main(int argc, char *argv[])
{
        initscr();
        cbreak();
        noecho();
        nonl();
        intrflush(stdscr, FALSE);
        keypad(stdscr, TRUE);
        start_color();

        printf("beep: %d\n", beep());
        fflush(stdout);

        printf("flash: %d\n", flash());
        fflush(stdout);

        return 0;
}





-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to