Strange beep when using cout

Posted by Unknown on Stack Overflow See other posts from Stack Overflow or by Unknown
Published on 2011-01-15T19:25:07Z Indexed on 2011/01/15 19:53 UTC
Read the original article Hit count: 264

Filed under:
|
|

Hello everyone,

today when I was working on some code of mine I came across a beeping sound when printing a buffer to the screen. Here's the mysterious character that produces the beep: '' I don't know if you can see it, but my computer beeps when I try to print it like this:

cout<<(char)7<<endl;

Another point of interest is that the 'beep' doesn't originate from my on board beeper, but from my headphone/speaker

Is this just my computer or there something wrong with the cout function?

EDIT:

But then why does printing this character produce the beep sound? does that mean that I could send other such characters through the cout function to produce different effects?

© Stack Overflow or respective owner

Related posts about c++

Related posts about cout