三级大问题

时间:2008-05-10 18:53:22   来源:论坛整理  作者:  编辑:chinaitzhe
请那位天才级的高手帮我解决以下问题,我先谢谢了.
vc6.0下的:
#include <stdio.h>
#include <conio.h>
#define MAXNUM 200

int xx[MAXNUM];
int totNum=0; /*文件IN.DAT中共有多少个正整数*/
int totCnt=0; /*符合条件的正整数的个数*/
double totPjz=0.0; /*平均值*/

int ReadDat(void);
void writeDat(void);

void CalValue(void)
{
int i;
for(i=0;i <MAXNUM;i )
{
if(xx[i]>0)
totNum ;
if((xx[i]>>1)%2==0)
{
totCnt ;
totPjz =(double)xx[i];
}
}
totPjz/=(double)totCnt;
}

void main()
{
int i;
clrscr();
for(i=0;i <MAXNUM;i )xx[i]=0;
if(ReadDat()){
printf("数据文件IN.DAT不能打开!\007\n");
return;

prog1.obj : error LNK2001: unresolved external symbol _clrscr
Debug/prog1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

prog1.exe - 2 error(s), 0 warning(s)
能否快点答复。非常感谢!一天更好。谢谢!

网友回复:错误不都提示了嘛

vc中没有clrscr用system替代吧
网友回复:
C/C code





Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/



#inlcude <stdlib.h>

...

system("cls");

...


网友回复:include 打错了,记得更正
网友回复:顶LS,LS正解,clrscr应该是TC下的清屏函数吧..在VC下没有这个函数,出错了.
网友回复:楼主不提俺都忘了这个函数了.
网友回复:嗯,又学到一招.
网友回复:在vc6.0中对于clrscr函数编译时只是有警告,不过在运行时就会出错
网友回复:...
网友回复:
引用 2 楼 Treazy 的回复:
C/C code#inlcude <stdlib.h>
...
system("cls");
...

网友回复:汗。。。
我不是天才级的
网友回复:
引用 2 楼 Treazy 的回复:
C/C code#inlcude <stdlib.h>...
system("cls");
...

网友回复:
上帝的回复:
#inlcude <stdlib.h>...
system("cls");
...

网友回复:TC下才使用 clrscr 的
关键字:三级,大问题,

文章评论

共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面