站長資訊網
        最全最豐富的資訊網站

        C語言函數大全 w

        函數名: wherex
        功  能: 返回窗口內水平光標位置
        用  法: int wherex(void);
        程序例:

        #include <conio.h>

        int main(void)
        {
           clrscr();
           gotoxy(10,10);
           cprintf(“Current location is X: %d  Y: %drn”, wherex(), wherey());
           getch();

           return 0;
        }
         
         
         

        函數名: wherey
        功  能: 返回窗口內垂直光標位置
        用  法: int wherey(void);
        程序例:

        #include <conio.h>

        int main(void)
        {
           clrscr();
           gotoxy(10,10);
           cprintf(“Current location is X: %d  Y: %drn”, wherex(), wherey());
           getch();

           return 0;
        }
         
         
         

        函數名: window
        功  能: 定義活動文本模式窗口
        用  法: void window(int left, int top, int right, int bottom);
        程序例:

        #include <conio.h>

        int main(void)
        {

           window(10,10,40,11);
           textcolor(BLACK);
           textbackground(WHITE);
           cprintf(“This is a testrn”);

           return 0;
        }
         
         
         

        函數名: write
        功  能: 寫到一文件中
        用  法: int write(int handel, void *buf, int nbyte);
        程序例:

        #include <stdio.h>
        #include <stdlib.h>
        #include <fcntl.h>
        #include <sysstat.h>
        #include <io.h>
        #include <string.h>

        int main(void)
        {
           int handle;
           char string[40];
           int length, res;

           /*
            Create a file named “TEST.$$$” in the current directory and write
            a string to it.  If “TEST.$$$” already exists, it will be overwritten.
           */

           if ((handle = open(“TEST.$$$”, O_WRONLY | O_CREAT | O_TRUNC,
                                 S_IREAD | S_IWRITE)) == -1)
           {
              printf(“Error opening file.n”);
              exit(1);
           }

           strcpy(string, “Hello, world!n”);
           length = strlen(string);

           if ((res = write(handle, string, length)) != length)
           {
              printf(“Error writing to the file.n”);
              exit(1);
           }
           printf(“Wrote %d bytes to the file.n”, res);

           close(handle);
           return 0;
        }

         

        贊(0)
        分享到: 更多 (0)
        網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號
        主站蜘蛛池模板: 精品人无码一区二区三区| 国产精品一级香蕉一区| 国产精品久久成人影院| 野狼精品社区| 成人精品一区二区久久久| 97久久久久人妻精品专区| 亚洲欧美日韩国产精品影院| 精品国产人成亚洲区| 欧美极品欧美精品欧美视频| 久久久久成人精品无码中文字幕| 久久人人超碰精品CAOPOREN| 91精品无码久久久久久五月天| 99在线精品一区二区三区| 熟女精品视频一区二区三区| 亚洲国产精品专区在线观看| 欧美久久亚洲精品| 免费短视频软件精品一区二区| 国产精品亚洲mnbav网站| 99精品电影一区二区免费看| 日本精品在线视频| 精品在线免费观看| 国产精品久久波多野结衣| 2022国产精品自产拍在线观看 | 精品久久久久久无码专区不卡 | 亚洲精品国产精品乱码在线观看| 精品一区二区三区四区在线| 国产区精品福利在线观看精品| 亚洲国产主播精品极品网红| 无码国产精品一区二区免费16| 日产国产精品亚洲系列| 国产亚洲曝欧美不卡精品| 91精品国产品国语在线不卡| 91精品国产自产在线观看| 99在线精品免费视频| 国产精品99| 精品久久久久久无码人妻热| 精品福利一区二区三区| 精品一区二区无码AV| 日本精品夜色视频一区二区| 亚洲国产一成久久精品国产成人综合| 伊人 久久 精品 |