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

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號
2020国产精品自拍| 热re99久久精品国99热| 久久精品青青草原伊人| 国精无码欧精品亚洲一区| 国产精品极品美女免费观看| 久久亚洲精品视频| 日韩熟女精品一区二区三区| 99热热久久这里只有精品166| 日韩在线视精品在亚洲| 国产精品视频yuojizz| 99久久免费国产精品热| 国产精品三级国语在线看| 久久久久国产精品免费看| 精品国产日韩亚洲一区在线| 亚洲国产日韩综合久久精品| 精品亚洲综合久久中文字幕| 日韩精品久久久久久| 久久精品国产2020| 蜜国产精品jk白丝AV网站| 国产AV午夜精品一区二区三区| 日韩AV高清在线看片| 日韩A∨精品日韩在线观看| 国产亚洲精品精品精品| 国产在视频线精品视频2021| 久久久久99精品成人片直播 | 日韩视频中文字幕| 日韩在线一区二区三区免费视频| 国产成人综合久久精品下载| 精品无码国产自产在线观看水浒传 | 日韩精品无码免费一区二区三区| 久久精品国产一区二区三区肥胖| 伊人精品视频在线| 日韩在线视精品在亚洲| 69精品免费视频| 国产成人精品无码一区二区三区| 日韩视频免费在线观看| 日韩精品在线观看| 日韩亚洲国产综合高清| 国产乱码精品一区二区三区麻豆 | 久久91精品国产99久久yfo| 日产精品一线二线三线芒果|