搜索

照抄书上让计算机发声的例子编译失败,错在哪里?

查看数: 2052 | 评论数: 3 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2013-7-15 11:30

正文摘要:

本帖最后由 嗨,强哥! 于 2013-7-15 11:35 编辑 {:soso_e106:}有图为证{:soso_e106:} #include <stdio.h> #include <stdlib.h> #include <dos.h>         & ...

回复

超神级 发表于 2013-7-30 22:07:07
为什么响了俩次{:soso_e103:}
嗨,强哥! 发表于 2013-7-16 09:34:37
rosynirvana 发表于 2013-7-15 13:51
sound delay nosound这三个函数不是iso C中的东西,估计是turbo C的
你可以用winapi代替
这里有个例子

#include <stdio.h>
#include <stdlib.h>

/*  编一个程序,让计算机发出响铃声,反复进行,直到  */
/*  用户输入字符'N'或'n'时为止。                                      */
/*                                                                                      */
/*                                                                                      */
/*  程序清单如下:                                                           */


int main()
{
    char yn='y';
    while (toupper(yn)!='N')   /*输入字符转换成大写后不是'N',继续循环*/
    {
        printf("\a");                   /*响铃*/
        scanf("%c",&yn);         /*继续读入用户选择*/
    }
    system("pause");
    return 0;
}

rosynirvana 发表于 2013-7-15 13:51:04
sound delay nosound这三个函数不是iso C中的东西,估计是turbo C的
你可以用winapi代替
这里有个例子
http://bbs.ahalei.com/thread-362-1-2.html

点评

十分感谢!  发表于 2013-7-15 14:15
快速回复 返回顶部 返回列表