当前位置: 动力学知识库 > 问答 > 编程问答 >

char - c++ bell sound in eclipse using '\a'

问题描述:

I am using Windows, Eclipse CDT and Mingw-w64. I want to call an alert ( aka bell aka beep) by using '\a' character literal.When I run this:

cout<<'\a';

computer doesn't produce any sound. I tried with endl, it didn't work. Sound on computer is on. I referred to this question, which technically asks the same thing, but it doesn't have any solution for Eclipse, it just tells that we need to try it in terminal, and tells that '\a' is not configured in Eclipse. My question is how can I force Eclipse to make the sound instead of printing square character?

P.S. I know there are other alternatives implementations for the beep sound, I want to use explicitly '\a'.

P.P.S In addition to alert literal, \b, \v, \f (backspace, vertical tab, formfeed) don't work as expected(maybe because output doesn't go to a printer), they print square chars and \r (carriage return) starts newline instead of going to the beginning of the current one.

分享给朋友:
您可能感兴趣的文章:
随机阅读: