How to make the hardware beep sound with c++?
Thanks
There are a few OS-specific routines for beeping.
On a Unix-like OS, try the (n)curses beep() function. This is likely to be more portable than writing '\a' as others have suggested, although for most terminal emulators that will probably work.
In some *BSDs there is a PC speaker device. Reading the driver source, the SPKRTONE ioctl seems to correspond to the raw hardware interface, but there also seems to be a high-level language built around write()-ing strings to the driver, described in the manpage.
It looks like Linux has a similar driver (see this article for example; there is also some example code on this page if you scroll down a bit.).
In Windows there is a function called Beep().