I have read all these posts about sounds, but no one answered my questions.
Please note, that I do not want to complicate me with operating systems, and so on. If that is possible, I want to write a platform independent program in C++.
Please answer this short questions, do not send me to other sites. Please always specify any required #include commands.
The '\a' and '\7' escapes won't just not work on all operating systems, they won't even work on all terminal emulators. There's literally no way of producing a beep in an os-independant way except by accessing the PC speaker directly (which isn't pretty, not to mention that most operating systems won't let you do it).
The best way to play a beep or any other sound is to use a cross-platform audio or multimedia library, like SFML or SDL. Indeed, the \a, \7, and \b escapes don't work across all platforms or across all terminal emulators, so you need an alternative.
You requested that we don't send you to other sites, but I'm going to ignore that and give you a link to the SFML site. It's a really easy to use and quite good library and I am NOT part of the dev team.