A Simple C++ Program to Draw a Line
Ubuntu (libgraph) - Graphics & Multimedia Lab
Program:
// #include<iostream> #include<graphics.h> using namespace std; int main() { int gd=DETECT,gm,x,y; initgraph(&gd,&gm,NULL); line(0,0,100,100); getch(); closegraph(); return 0; }
Output:
nn@linuxmint ~ $ g++ cg2.cpp -lgraph nn@linuxmint ~ $ ./a.out
i did the same but error occured at run time undefined symbol line
ReplyDeleteundefined symbol closegraph
undefined symbol initgraph
buhahahaaaaaaaaaaaa................
ReplyDeletesangathi toppaekkanu...
it's case sensetive and remember to type NULL in capitals
ReplyDeleteint#include
ReplyDelete#include
using namespace std;
int main()
{
int gd=DETECT,gm,x,y;
initgraph(&gd,&gm,NULL);
line(0,0,100,100);
getch();
closegraph();
return 0;
}
DIAC-Plc Training in Noida|Automation Training in Noida|SCADA Training in Noida
ReplyDeleteContact Us +91-99534 89987, +91-97112 87737