Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Draw a line in C++ graphics
In this tutorial, we will be discussing a program to draw a line in C++ graphics.
To implement different shapes and sizes, animations, graphics.h library is used in C++.
Example
#include <graphics.h>
int main(){
int gd = DETECT, gm;
initgraph(&gd, &gm, "");
line(150, 150, 450, 150);
line(150, 200, 450, 200);
line(150, 250, 450, 250);
getch();
closegraph();
return 0;
}
Output

Advertisements
