You are here

linerel function in c

Linerel function draws a line from the current position(CP) to a point that is a relative distance (x, y) from the CP, then advances the CP by (x, y). You can use getx and gety to find the current position.

C programming code for linerel

#include <graphics.h>
#include <conio.h>
   int gd = DETECT, gm;
   initgraph(&gd, &gm, "C:\\TC\\BGI");
   moveto(250, 250);
   linerel(100, -100);
   return 0;