C/C 的DOS.H中的函数/延迟/nosound

functions sound/delay/nosound in dos.h for c/c++

本文关键字:延迟 函数 nosound DOS      更新时间:2023-10-16

如何获得语言C/C 的版本(下载?),函数声音,nosound,delay存在于库中,dos.h?例如,它在Code :: Blocks上的C/C 版本中不存在。为了使用/找到函数声音/nosound/延迟,我该怎么办?谢谢您的帮助!

下载(叹气)Turboc/Turboc 的副本。

在Windows程序中您可以使用win32函数:

  • Sleep()作为delay()的替代品
  • Beep()作为sound() delay() nosound()的组合的替代品。

如果您在Win 7中超过7个,请使用DOS Box下载Borland Turbo C 要收听500 miliseconds的哔哔声,请使用以下代码

#include<iostream.h>
#include<conio.h>
#include<dos.h>
void main()
{clrscr();  //for clearing the screen...
int x;
x=1000;         // here 1000 is the frequency of the sound 
sound(x);       //u can directly write integer in the place of x
delay(500);
nosound();      //it is necessary to close the sound or u will keep on hearing
getch();        // to wait at the end of program
}