"未定义REFRENCE TO clrscr();" [英] "UNDEFINED REFRENCE TO clrscr();"

查看:308
本文介绍了"未定义REFRENCE TO clrscr();"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include<stdio.h>
#include<conio.h>
void main()
{
int i=1,a,b,c,choice;
do
{
    printf("enter any two numbers\n");
    scanf("%d%d",&a,&b);
    printf("pressing one add the two numbers\nenter one if you want to\n");
    scanf("%d",&choice);
    switch(choice)
    {
        case 1:
            {
                c=a+b;
                printf("the sum of the entered numbers%.1f\n\n:",c);
                break;
            }
        default:
            printf("you have entered an invalid");
            break;
    }
    clrscr();
}
while(i==1);
getch();
}

我不知道因为我的同学是使用涡轮c和它的罚款,对我来说我使用开发的C ++不过貌似clrscr();不知道编译器的帮助,请。

i do not know cause my classmate is using turbo c and it's fine,for me i am using dev c++ but looks like clrscr(); is not known to the compiler help please.

推荐答案

您的同学编程DOS下,显然你不... CONIO.H 自带Turbo C的和DOS ...所以,删除线

Your classmate is programming under DOS, obviously you don't ... conio.h comes with Turbo C and DOS ... So, remove the lines

#include<conio.h>

clrscr();

getch();

让你的程序编译...

to make your program compile ...

...不要使用%。1F 打印一个int。

... and do not use %.1f to print an int.

...和的main()必须返回 INT

*不要从你的同学复制......他似乎被卡在石器时代*

这篇关于&QUOT;未定义REFRENCE TO clrscr();&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆