i just got Borland
and wrote this code which is meant to be used with
turbo c++
i got borland 5.0
Code:/*initgraph example a simple program to demonstrate the init graph and draw a line from on diagonal of the screen to the other*/ #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; /* initialize graphics mode */ initgraph(&gdriver, &gmode, "C:\\tc\\bgi");// yes i //changed //this to my borland bgi folder /* read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) /* an error occured */ { printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); /* return with error code */ } /* draw a line from (0,0) to (max X, max Y)*/ int x=getmaxx()/2, y=getmaxy()/2; bar(x-10,y-10,x+10,y+10); /* clean up*/ getch(); getch(); /* two getch() needed as characters will carry through the buffer some keystrokes can carry through the buffer*/ closegraph(); return 0;
// i get error saying BGI graphics not supported under windows
//thanks in advance



LinkBack URL
About LinkBacks


