How to make the hardware beep sound with c++?
Thanks
If you're using Windows OS then there is a function called Beep()
#include
#include // WinApi header
using namespace std;
int main()
{
Beep(523,500); // 523 hertz (C5) for 500 milliseconds
cin.get(); // wait
return 0;
}
Source: http://www.daniweb.com/forums/thread15252.html
For Linux based OS there is:
echo -e "\007" >/dev/tty10
And if you do not wish to use Beep() in windows you can do:
echo "^G"
Source: http://www.frank-buss.de/beep/index.html