Hello friends
I am new to c++ and i have installed graphicsin codeblocks
following this tutorial How to include graphics.h in CodeBlocks? | Code with C
but when i try to run this code ..it shows blank screen instead of 3 lines
Code:
#include<graphics.h>using namespace std;
int main()
{
// gm is Graphics mode which is a computer display
// mode that generates image using pixels.
// DETECT is a macro defined in "graphics.h" header file
int gd =DETECT,gm;
// initgraph initializes the graphics system
// by loading a graphics driver from disk
initgraph(&gd,&gm,"");
// line for x1, y1, x2, y2
line(150, 150, 450, 150);
// line for x1, y1, x2, y2
line(150, 200, 450, 200);
// line for x1, y1, x2, y2
line(150, 250, 450, 250);
getch();
// closegraph function closes the graphics
// mode and deallocates all memory allocated
// by graphics system .
closegraph();
}
any help will be appreciated..thanks