语言库函数类字母牛
民生理财 2021-08-24 13:31 字号: 大 中 小
函数名: wherex
功 能: 返回窗口内水平光标位置
用 法: int wherex(void);
程序例:
#include conio.h
int main(void)
{
clrscr();
gotoxy(10,10);
cprintf(\"Current location is X: %d Y: %d\\r\\n\", 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: %d\\r\\n\", 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 test\\r\\n\");
return 0;
}
“全球最赚钱银行”的工行 函数名: write
功 能: 写到一文件中
用 法: int write(int handel, void *buf, int nbyte);
程序例:
#include stdio.h
#include stdlib.h
#include fcntl.h
#include sys\\stat.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;
}
石家庄妇科较好医院天津看白癜风专业医院
吴忠白癜风哪里治疗好
-
-
天津女排踏上复兴之路阵容重组陈丽怡仍是中
天津女排踏上复兴之路 阵容重组陈丽怡仍是中坚天津女排夺冠...
2020-07-07 | 民生理财
-
-
专家房产税征收受到九成以上政府官员阻挠搭配
专家:房产税征收受到九成以上政府官员阻挠 “要搞好房地产...
2020-06-06 | 民生理财
-
-
海南西环高速铁路正式试运行和谐号动车疾驰搭配
海南西环高速铁路正式试运行 和谐号动车疾驰前进 11月26日,...
2020-06-02 | 民生理财
-
-
北京市机动车停车条例搭配
北京市机动车停车条例(2018年3月30日北京市第十五届人民代表...
2020-05-31 | 民生理财
-
-
决胜局独揽分李盈莹表现出彩担任接应效果不搭配
决胜局独揽分李盈莹表现出彩 担任接应效果不佳李盈莹中国女...
2020-05-30 | 民生理财
-
-
特评从C罗到彩票佛爷的任性主帅为他背锅搭配
特评:从C罗到彩票!佛爷的任性 主帅为他背锅原标题:特评...
2020-05-29 | 民生理财