[C] 在视区显示一个字符串 →→→→→进入此内容的聊天室

来自 , 2020-12-08, 写在 C, 查看 146 次.
URL http://www.code666.cn/view/c3614206
  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.    int midx, midy;
  11.  
  12.    /* initialize graphics and local variables */
  13.    initgraph(&gdriver, &gmode, "");
  14.  
  15.    /* read result of initialization */
  16.    errorcode = graphresult();
  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); /* terminate with an error code */
  23.    }
  24.  
  25.    midx = getmaxx() / 2;
  26.    midy = getmaxy() / 2;
  27.  
  28.    /* move the C.P. to the center of the screen */
  29.    moveto(midx, midy);
  30.  
  31.    /* output text starting at the C.P. */
  32.    outtext("This ");
  33.    outtext("is ");
  34.    outtext("a ");
  35.    outtext("test.");
  36.  
  37.    /* clean up */
  38.    getch();
  39.    closegraph();
  40.    return 0;
  41. }

回复 "在视区显示一个字符串"

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

captcha