[C] 确定图形驱动程序和模式 →→→→→进入此内容的聊天室

来自 , 2020-10-26, 写在 C, 查看 111 次.
URL http://www.code666.cn/view/db116b39
  1. #include <graphics.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <conio.h>
  5.  
  6. /* names of the various cards supported */
  7. char *dname[] = { "requests detection",
  8.                   "a CGA",
  9.                   "an MCGA",
  10.                   "an EGA",
  11.                   "a 64K EGA",
  12.                   "a monochrome EGA",
  13.                   "an IBM 8514",
  14.                   "a Hercules monochrome",
  15.                   "an AT&T 6300 PC",
  16.                   "a VGA",
  17.                   "an IBM 3270 PC"
  18.                 };
  19.  
  20. int main ( void )
  21. {
  22.         /* returns detected hardware info. */
  23.         int gdriver, gmode, errorcode;
  24.  
  25.         /* detect graphics hardware available */
  26.         detectgraph ( &gdriver, &gmode );
  27.  
  28.         /* read result of detectgraph call */
  29.         errorcode = graphresult();
  30.         if ( errorcode != grOk )  /* an error
  31.          occurred */
  32.         {
  33.                 printf ( "Graphics error: %s\n", \
  34.                          grapherrormsg ( errorcode ) );
  35.                 printf ( "Press any key to halt:" );
  36.                 getch();
  37.                 exit ( 1 ); /* terminate with an error
  38.     code */
  39.         }
  40.  
  41.         /* display the information detected */
  42.         clrscr();
  43.         printf ( "You have %s video display \
  44.   card.\n", dname[gdriver] );
  45.         printf ( "Press any key to halt:" );
  46.         getch();
  47.         return 0;
  48. }
  49.  

回复 "确定图形驱动程序和模式"

这儿你可以回复上面这条便签

captcha