请高手指点一下哪里错了

来源:互联网 发布:php手册最新版下载 编辑:程序博客网 时间:2024/05/01 10:20

 

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
 
int main(void)
{
   /* request auto detection */
   int gdriver, gmode; 
   /* initialize graphics and local variables */
   detectgraph(&gdriver, &gmode);
   printf(" %d,%d/n", gdriver, gmode);
   getch();
   setcolor(4);              
   setlinestyle(0, 0, 3);
   initgraph(&gdriver, &gmode, "c://tc");
 
   /* read result of initialization */
 
   DDAline(0,0, 200,200);
   getch();
   closegraph();
   return 0;
}
 DDAline(int x0,int y0,int x1,int y1)
{
 float x,y,dx,dy,k;
 int i;
 dx=x1-x0;
 dy=y1-y0;
 k=dy/dx;
 x=x0;
 y=y0;
 for( i=0;i<=dx;i++)
   {
    SetPoint(x,(int)(y+0.5),98);
    x+=1;
    y+=k;
    }
 }

我刚学的c这样写了但是运行不了,请高手帮忙看看是哪里出错了。