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

后端 未结 3 975
小蘑菇
小蘑菇 2020-12-22 03:21

How can I get a version of language C/C++(downloaded??) where the functions sound, nosound, delay are present in the library DOS.H? For example it doesn\'t exist in the ver

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-22 03:54

    if u r having above win 7,, Download borland Turbo c++ using dos box to listen to a beep for 500 miliseconds, use the following code,

    #include
    #include
    #include
    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
    }
    

提交回复
热议问题