C语言做动画的问题

来源:百度知道 编辑:UC知道 时间:2024/07/05 02:49:48
有没有高手可以不吝赐教一下为什么下面这个程序在运行到最后一个画面的时候没等我敲击键盘它就自动退出了还跟我说有错误?
#include "stdio.h"
#include "graphics.h"
main()
{
int graphdriver=DETECT,graphmode;
int i,j,k,size1,size2,size3;
void *buffer1,*buffer2,*buffer3;
initgraph(&graphdriver,&graphmode,"");
cleardevice();
setbkcolor(9);
setcolor(14);
setfillstyle(1,7);
circle(60,180,20);
floodfill(60,180,14);
circle(140,180,20);
floodfill(140,180,14);
circle(100,210,30);
floodfill(100,210,14);
circle(100,280,40);
floodfill(100,280,14);
circle(150,280,10);
floodfill(150,280,14);
setcolor(4);
setfillstyle(1,8);
circle(85,205,3);
floodfill(85,205,4);
circle(115,205,3);
floodfill(115,205,4);
circle(100,220,5);
floodfill(100,220,4);
setcolor(14);
rectangle(16

kbhit是函数还是变量啊
看到两处kbhit不一样
中间有一行while(kbhit());
最后有一行while(!kbhit);

为什么不直接用getch();这个函数是阻塞函数,去掉最后的while(!kbhit);

我没装TC,没办法调试