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

        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號
        主站蜘蛛池模板: 国产三级精品三级| 亚洲国产精品无码专区| 亚洲精品狼友在线播放| 99视频在线精品国自产拍亚瑟| 人人妻人人澡人人爽人人精品97 | 亚洲精品动漫免费二区| 精品一区二区久久| 国产伦精品免编号公布| 尤物国精品午夜福利视频| 国产一区二区精品久久岳| 3级黄性日本午夜精品| 国产精品涩涩涩视频网站| 真实国产精品vr专区| 久久久精品国产Sm最大网站| 先锋影音国产精品| 成人国内精品久久久久影院| 久久香综合精品久久伊人| 97精品国产自在现线免费观看 | 西瓜精品国产自在现线| 国产精品无码v在线观看| 久久91精品国产91久久麻豆| 国产成人精品一区二区三区免费| 亚洲国产精品无码成人片久久| 无码精品人妻一区二区三区影院 | 亚洲&#228;v永久无码精品天堂久久| 国产天天综合永久精品日| 99久久人人爽亚洲精品美女| 青青草原综合久久大伊人精品| 久久99国产精品久久99| 久久精品国产秦先生| 国内精品91最新在线观看| 国产精品www| 国产精品国产精品国产专区不卡 | 日产国产精品亚洲系列| 久久精品国产第一区二区| 久久久精品波多野结衣| 日韩精品一区二区三区在线观看| 日本精品一区二区久久久| 亚洲综合精品网站| 亚洲国产精品无码久久一线| 久久亚洲美女精品国产精品|