爱问知识人 爱问教育 医院库

C语言高手请进

首页

C语言高手请进

setw函数在C++中能用,在C中能用吗?如果不能用那有哪些函数能完成类似的功能啊?

提交回答

全部答案

    2006-05-23 17:52:32
  •   函数名: setwritemode
    功  能: 设置图形方式下画线的输出模式
    用  法: void far setwritemode(int mode);
    程序例:
    #include 
    #include 
    #include 
    #include 
    int main()
    {
       /* request auto detection */
       int gdriver = DETECT, gmode, errorcode;
       int xmax, ymax;
       /* initialize graphics and local variables */
       initgraph(&gdriver, &gmode, "");
       /* read result of initialization */
       errorcode = graphresult();
       if (errorcode != grOk)  /* an error occurred */
       {
          printf("Graphics error: %s\n", grapherrormsg(errorcode));
          printf("Press any key to halt:");
          getch();
          exit(1); /* terminate with an error code */
       }
       xmax = getmaxx();
       ymax = getmaxy();
       /* select XOR drawing mode */
       setwritemode(XOR_PUT);
       /* draw a line */
       line(0, 0, xmax, ymax);
       getch();
       /* erase the line by drawing over it */
       line(0, 0, xmax, ymax);
       getch();
       /* select overwrite drawing mode */
       setwritemode(COPY_PUT);
       /* draw a line */
       line(0, 0, xmax, ymax);
       /* clean up */
       getch();
       closegraph();
       return 0;
    }
     如果觉的我答案有用,请点赞。
      

    a***

    2006-05-23 17:52:32

类似问题

换一换
  • C/C++ 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 176-195
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):