 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you the use of line to function, which is used to draw a line from current position to the desired position. Before starting, you can subscribe my YouTube channel by clicking on the link which is available at bottom right corner of this video. You can download my app Takeness that is available on Google Play. You can connect with me by following these details which are available in front of you. For demonstration, I have included two header files, connu and graphics.h. Then I have declared variables gd and gm. gd stands for graphics driver and gm is for graphics mode. gd is initialized with detect. It will automatically identify the graphics driver and gm is for graphics mode. Then init graph function is called which is used to initialize graphics. gd, gm and a path. Three arguments are passed inside it. gd stands for graphics driver. gm is for graphics mode and this path is containing graphics related libraries. So c, t, c and bdi is that path. Now, first I am moving to 100, 100 position using move to function. So current x coordinate position is 100 and y coordinate position is also 100. Now I am using line to function. I want to draw a line from 100, 100 to 200, 200. So current position is 100, 100 using move to function and ending or desired position is 200, 200, which I have passed inside line to function. So a line will be drawn from 100, 100 to 200, 200. Then getch function is used to hold the screen. Close graphics to deallocate the graphics which are initialized. Return zero because return type of main is integer. Now I am executing this code. You can see a line is drawn from 100, 100 to 200, 200 using line to function. If you want to apply color to this line, you can use set color function. Now you can see line is drawn in red color. You can also apply various line styles on this function. So with the help of move to and line to functions, you can draw a line starting from the current position to the desired position. I hope you have understood how we can apply line to function in graphics. This function is predefined in graphics.h header file. If you want to watch more programming related videos, you can subscribe my YouTube channel that is sanjaygupta underscore tech school. Thank you for watching this video.