鱼C论坛

 找回密码
 立即注册
查看: 4543|回复: 4

库函数调用问题

[复制链接]
发表于 2012-10-12 09:34:12 | 显示全部楼层 |阅读模式
20鱼币
#include<stdio.h>
#include<conio.h>
int main()
{
        float x1,x2,x3,x4,x5,ave;
       
        printf("please input 5 scores\n");
        scanf("%f%f%f%f%f",&x1,&x2,&x3,&x4,&x5);
        ave = (x1+x2+x3+x4+x5)/5;
        printf("The average is %.1f\n",ave);
        getch();
        clrscr();
}
编译后这么显示
--------------------Configuration: test - Win32 Debug--------------------
Compiling...
2.c
E:\项目文件\c文件\test\2.c(12) : warning C4013: 'clrscr' undefined; assuming extern returning int

2.obj - 0 error(s), 1 warning(s)
说clrscr没有定义......郁闷了....
函数大全的例程

函数名: clrscr功  能: 清除文本模式窗口用  法: void clrscr(void);程序例:#include <conio.h>int main(void){   int i;   clrscr();   for (i = 0; i < 20; i++)      cprintf("%d\r\n", i);   cprintf("\r\nPress any key to clear screen");   getch();   clrscr();   cprintf("The screen has been cleared!");   getch();   return 0;}也同样不行....是不是头文件包含的不对啊....

小甲鱼最新课程 -> https://ilovefishc.com
发表于 2012-10-12 10:27:38 | 显示全部楼层
VC6里面已经没有这个函数了,
用system("CLS");代替 clrscr();
来清屏幕就可以了
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2012-10-12 18:50:36 | 显示全部楼层
是不是很多函数都没有了啊...前面我也遇到无法调用
函数名: random
功  能: 随机数发生器
函数名: randomize
功  能: 初始化随机数发生器
这两个也无法调用....
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2012-10-12 20:36:32 | 显示全部楼层
尽量用标准C的库函数,如随机数用
#include <stdlib.h>
里面的
time_t time( time_t *time );

int rand( void );
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2012-10-12 20:52:43 | 显示全部楼层
嗯....看来我这里那份 <<C语言函数大全语法>>,这个文件不能在用了.....现在杂七杂八的资料很乱..头大啊
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2026-2-10 21:04

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表