c/c++声音问题

来源:百度知道 编辑:UC知道 时间:2024/06/25 07:49:19
为何我在运行下面的程序时没有声音?
include <dos.h>
int main(void)
{
sound(700);delay(500);
sound(1500);delay(1000);
nosound();
return 0;
}
用turbo c运行后只是闪了一下子却没有声音???
我按两位说的去执行了一下,虽说不闪了,可还是没有声音啊!

试试看在return 前边加上 getchar();

我刚才查了下资料 好像需要一个 delay 函数
具体你看这个:
#include <dos.h>

int main(void)
{
sound(7);
delay(10000);
nosound();
return 0;
}
或者这个

http://www.aub.org.cn/mypdf/72478.pdf

楼上说的基本对,不过不是getchar(),而是getch()