Initializing the graphics system

From , 5 Years ago, written in C, viewed 106 times.
URL https://pastebin.vip/view/90aef91f
  1. #include <graphics.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <conio.h>
  5.  
  6. int main(void)
  7. {
  8.    /* request auto detection */
  9.    int gdriver = DETECT, gmode, errorcode;
  10.  
  11.    /* initialize graphics mode */
  12.    initgraph(&gdriver, &gmode, "");
  13.  
  14.    /* read result of initialization */
  15.    errorcode = graphresult();
  16.  
  17.    if (errorcode != grOk)  /* an error occurred */
  18.    {
  19.       printf("Graphics error: %s\n", grapherrormsg(errorcode));
  20.       printf("Press any key to halt:");
  21.       getch();
  22.       exit(1);             /* return with error code */
  23.    }
  24.  
  25.    /* draw a line */
  26.    line(0, 0, getmaxx(), getmaxy());
  27.  
  28.    /* clean up */
  29.    getch();
  30.    closegraph();
  31.    return 0;
  32. }
  33.  

Reply to "Initializing the graphics system"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website