TC的问题?
我在tc里输入下面的程序怎么有问题呀?
不知道怎么用tc,所以请教大家?
请大家不赐教!!
我输入的代码如下:
#include "stdio.h"
#include "conio.h"
#include "graphics.h"
void DDA_line(x0 , y0 , x1 , y1 , color)
{
int x ;
float y , k , deltx , delty ;
deltx = x1 - x0 ;
delty = y1 - y0 ;
k = delty / deltx ;
y = y0 ;
for(x=x0 ; x <= x1 ; x++)
{
putpuxel(x , int(y+0.5) , color) ;
y = y + k ;
}
}
main()
{
int a0 = 5 , a1 = 10 , b0 = 3 , b1 = 8 ;
int col = 1 ;
DDA_line(a0 , b0 , a1 , b1 , col) ;
// printf("Hello, world\n");
getch();
}