Coding

lineto function in c

lineto function in c - c programming - lineto function draws a line from current position(CP) to the point(x,y),

lineto function draws a line from current position(CP) to the point(x,y), you can get current position using getx and gety function.

C programming code for lineto

#include<graphics.h>
#include<conio.h>
 
main()
{
   int gd = DETECT, gm;
 
   initgraph(&gd, &gm, "C:\\TC\\BGI");
 
   moveto(100, 100);
   lineto(200, 200);   
 
   getch();
   closegraph();
   return 0;
}

About the author

Wikitechy Editor

Wikitechy Founder, Author, International Speaker, and Job Consultant. My role as the CEO of Wikitechy, I help businesses build their next generation digital platforms and help with their product innovation and growth strategy. I'm a frequent speaker at tech conferences and events.

Add Comment

Click here to post a comment