I don't know why \a
is not working. My code is working and displays in terminal. My code:
#include <stdio.h>
int main()
{
printf("hello world\a");
return 0;
}
My IDE: Visual Studio Code
My Compiler: Mingw gcc
The behavior of \a
depends on the environment/terminal you use.
My guess is that Windows does not implement it or perhaps it is disabled for some reason. There is not much you can do unless you use platform-specific APIs that play a specific sound.