Please help to those who know how to code
or those who are brilliant in c++
to code a beep or a sound in a borland c++
cause i want to learn how to make or to
code it;
and i don't have a background of coding
a beep, please help me!!!
I'm a beginner to this forum !

Dani AI

Generated

Quick clarification and practical guidance for this old thread. The behaviour people are seeing depends entirely on the toolchain and runtime. Turbo/Borland C++ is a legacy DOS compiler; when run on modern Windows 7 it is often inside an emulator or virtual machine, or simply incompatible on 64-bit systems. That environment will treat sound very differently from a native Windows program that uses the OS multimedia APIs. This explains why suggestions from and both "work" in their own contexts.

Three realistic approaches, with tradeoffs:

  • Terminal/console bell: simplest, but unreliable on modern hardware and emulators because it depends on the terminal and a PC speaker being present or emulated.
  • OS tone generation: uses the platform API to synthesize a tone. Gives control over pitch/duration but needs a compiler and libraries that link to the Windows runtime.
  • Play a short sample (WAV): most portable and predictable on Windows 7; works with the multimedia API or any small audio library and avoids PC-speaker quirks.

Practical notes tied to this thread: when sticking with Turbo C++ expect DOS-era limitations; using DOSBox or a VM makes that explicit but keeps behaviour old-style. For consistent, learnable results on Windows 7, a maintained toolchain (MinGW/Code::Blocks, Visual Studio Community, or similar) is recommended so the program can call modern APIs or use a lightweight audio library (SDL, SFML) without emulator quirks. is right to suggest multiple solutions for future readers—pick the one that matches the compiler/runtime being used.

Quick troubleshooting checklist: confirm the machine actually has working audio drivers and an enabled output device, verify whether the program runs native or inside an emulator, and use a modern toolchain if predictable sound is the goal.

Recommended Answers

All 4 Replies

Well.. then i think u shud read atleast a book before starting..
Regarding ur answer....

#include<iostream.h>
#include<conio.h>

int main()
   {  cout<<"This is to make a beep\a";
      return 0;
    }

Its basically the "\a" that makes the beep.

He specifically asked about Turbo C++..

He specifically asked about Turbo C++..

I think Referencing that link would help for future viewers of this thread because of the different solutions :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.