How to produce beep sound using “\a” escape character?

前端 未结 6 1486
渐次进展
渐次进展 2021-01-04 06:24

If I write the following program, then there is no beep sound on running the code.

#include 
int main()
{ 
    printf(\"\\a\");
    return 0;
         


        
6条回答
  •  悲&欢浪女
    2021-01-04 06:38

    I agree with @Steve Jessop. People will go to great lengths to keep their computers quiet.

    In Windows: As an alternative to "\a", you could use WinAPI's Beep command. If you are using Windows 7, this may not work as expected.

    Beep Function (Windows)

提交回复
热议问题