Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>line() draw a line</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 line()                  Draw a Line

 #include   <graphics.h>

 void far   line(x1,y1,x2,y2);
 int        x1,y1;
 int        x2,y2;

    line() draws a line between two specified points, ('x1','y1'), and
    ('x2','y2'). The line is drawn in the current color, line style and
    thickness.  The current position (CP) in not affected by a call to
    this function.

    Returns:    Nothing.

   -------------------------------- Example ---------------------------------

    The following statements use line() to draw a tic-tac-toe board on
    the screen.

           #include <graphics.h>
           #include <conio.h>

           int gdriver = DETECT;
           int gmode;

           main()
           {
               int x;

               initgraph(&gdriver,&gmode,"");
               line(100,100,540,100);
               line(100,200,540,200);
               line(247,10,247,301);
               line(394,10,394,301);
               getch();
               closegraph();
           }


See Also: getcolor() getlinesettings() lineto() linerel()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson