Console.WriteLine () Creates a sound when Convert.ToChar (7) is placed in it

When i run the code

Console.WriteLine(Convert.ToChar(Convert.ToByte(7))) 

My computer makes noise, I confirmed that it also works on a computer running Windows 7. I use Windows 10. I believe that this is either due to the way Unicode or the console handles this character, I'm not quite sure. Any help in understanding this would be greatly appreciated.

+5
source share
1 answer

char 7 is the BELL character. In the early days, you can force the motherboard to make an audio signal with just a key on the keyboard or a symbol placed on the terminal.

When you output this character using the command line program, it plays that sound.

+6
source

Source: https://habr.com/ru/post/1275313/


All Articles