c语言函数大全(O开头)

c语言函数大全(O开头)

There is no nutrition in the blog content. After reading it, you will not only suffer from malnutrition, but also impotence.
The blog content is all parallel goods. Those who are worried about being cheated should leave quickly.

函数名: open
功 能: 打开一个文件用于读或写
用 法: int open(char *pathname, int access[, int permiss]);
程序例:
#include
#include
#include
#include
int main(void)
{
int handle;
char msg[] = "Hello world";
if ((handle = open("TEST.$$$", O_CREAT | O_TEXT)) == -1)
{
perror("Error:");
return 1;
}
write(handle, msg, strlen(msg));
close(handle);
return 0;
}


函数名: outport
功 能: 输出整数到硬件端口中
用 法: void outport(int port, int value);
程序例:
#include
#include
int main(void)
{
int value = 64;
int port = 0;
outportb(port, value);
printf("Value %d sent to port number %d\n", value, port);
return 0;
}


函数名: outportb
功 能: 输出字节到硬件端口中
用 法: void outportb(int port, char byte);
程序例:
#include
#include
int main(void)
{
int value = 64;
int port = 0;
outportb(port, value);
printf("Value %d sent to port number %d\n", value, port);
return 0;
}


函数名: outtext
功 能: 在视区显示一个字符串
用 法: void far outtext(char far *textstring);
程序例:
#include
#include
#include
#include
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
/* 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 */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
/* move the C.P. to the center of the screen */
moveto(midx, midy);
/* output text starting at the C.P. */
outtext("This ");
outtext("is ");
outtext("a ");
outtext("test.");
/* clean up */
getch();
closegraph();
return 0;
}


函数名: outtextxy
功 能: 在指定位置显示一字符串
用 法: void far outtextxy(int x, int y, char *textstring);
程序例:
#include
#include
#include
#include
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
/* 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 */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
/* output text at the center of the screen*/
/* Note: the C.P. doesn't get changed.*/
outtextxy(midx, midy, "This is a test.");
/* clean up */
getch();
closegraph();
return 0;
}

相关推荐

  1. c语言函数大全(O开头)

    2024-03-24 16:52:03       16 阅读
  2. c语言函数大全(C开头)

    2024-03-24 16:52:03       19 阅读
  3. c语言函数大全(D开头)

    2024-03-24 16:52:03       18 阅读
  4. c语言函数大全(I开头)

    2024-03-24 16:52:03       16 阅读
  5. c语音函数大全(S开头)

    2024-03-24 16:52:03       20 阅读
  6. c语音函数大全(U开头)

    2024-03-24 16:52:03       17 阅读
  7. c语音函数大全(W开头)

    2024-03-24 16:52:03       17 阅读
  8. c语音函数大全(V开头)

    2024-03-24 16:52:03       16 阅读
  9. C语言获取时间函数大全

    2024-03-24 16:52:03       29 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-24 16:52:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-24 16:52:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-24 16:52:03       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-24 16:52:03       20 阅读

热门阅读

  1. ARPACK-ng安装教程

    2024-03-24 16:52:03       19 阅读
  2. 游戏开发全过程游戏外包

    2024-03-24 16:52:03       20 阅读
  3. c++ struct解释

    2024-03-24 16:52:03       21 阅读
  4. 高精度算法

    2024-03-24 16:52:03       19 阅读
  5. 蓝桥杯2019年第十届省赛真题-不同的子串

    2024-03-24 16:52:03       25 阅读
  6. MySQL查询

    2024-03-24 16:52:03       17 阅读
  7. AI 工具能检测到医生未发现的癌症征兆

    2024-03-24 16:52:03       16 阅读
  8. 蓝桥杯基础数论(Python组)

    2024-03-24 16:52:03       19 阅读
  9. python 运算符

    2024-03-24 16:52:03       18 阅读
  10. C语言归并排序的实现

    2024-03-24 16:52:03       19 阅读