📄 w.htm
字号:
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>[ 永远的UNIX > C语言库函数(W类字母) ]</title><style type="text/css"><!--body,th,input,select,textarea,select,checkbox{font:12pt 宋体}A:link { text-decoration:underline; color:#E6A306}A:visited { text-decoration:underline; color:#E6A306}A:hover { text-decoration:underline; color:#FFFF00}body { font-family: "宋体", "serif"; font-size: 12pt}td { font-family: "宋体", "serif"; font-size: 12pt}p { font-size: 9pt; line-height: 150%}--></style></head><body text="#ffffff" background="/images/bline.gif" bgcolor="#000000"><div align="center"><center><table border="0" width="750" cellspacing="0" cellpadding="0" height="400"><tr> <td height="45"><p align="center"><img src="/images/title.gif" alt="[ 永远的UNIX::UNIX技术资料的宝库 ]"></td> </tr> <tr><tr> <td align=left height="40" valign=bottom align=left><small><a href="/">首页</a> > 编程技术 > C/C++ > 正文</small></td></tr><tr> <td width="100%" height="2" colspan="5" bgcolor="#D09F0D"><img src="/images/c.gif" width=1 height=1></td> </tr><tr> <td align=center height="40" valign=middle><font size=5><b>C语言库函数(W类字母)</b></font></td></tr><tr> <td align=center height="20"><font color=#999999><small>本文出自: 作者: (2001-10-27 13:05:00)</small></font></td></tr><td align=center><table border="0" width="700" cellspacing="0" cellpadding="0" align=center><tr><td valign=top><font color=#cccccc>
<br>函数名: wherex
<br>功 能: 返回窗口内水平光标位置
<br>用 法: int wherex(void);
<br>程序例:
<br>
<br>#include <conio.h>
<br>
<br>int main(void)
<br>{
<br> clrscr();
<br> gotoxy(10,10);
<br> cprintf("Current location is X: %d Y: %d\r\n", wherex(), wherey());
<br> getch();
<br>
<br> return 0;
<br>}
<br>
<br>
<br>
<br>
<br>函数名: wherey
<br>功 能: 返回窗口内垂直光标位置
<br>用 法: int wherey(void);
<br>程序例:
<br>
<br>#include <conio.h>
<br>
<br>int main(void)
<br>{
<br> clrscr();
<br> gotoxy(10,10);
<br> cprintf("Current location is X: %d Y: %d\r\n", wherex(), wherey());
<br> getch();
<br>
<br> return 0;
<br>}
<br>
<br>
<br>
<br>
<br>函数名: window
<br>功 能: 定义活动文本模式窗口
<br>用 法: void window(int left, int top, int right, int bottom);
<br>程序例:
<br>
<br>#include <conio.h>
<br>
<br>int main(void)
<br>{
<br>
<br> window(10,10,40,11);
<br> textcolor(BLACK);
<br> textbackground(WHITE);
<br> cprintf("This is a test\r\n");
<br>
<br> return 0;
<br>}
<br>
<br>
<br>
<br>
<br>函数名: write
<br>功 能: 写到一文件中
<br>用 法: int write(int handel, void *buf, int nbyte);
<br>程序例:
<br>
<br>#include <stdio.h>
<br>#include <stdlib.h>
<br>#include <fcntl.h>
<br>#include <sys\stat.h>
<br>#include <io.h>
<br>#include <string.h>
<br>
<br>int main(void)
<br>{
<br> int handle;
<br> char string[40];
<br> int length, res;
<br>
<br> /*
<br> Create a file named "TEST.$$$" in the current directory and write
<br> a string to it. If "TEST.$$$" already exists, it will be overwritten.
<br> */
<br>
<br> if ((handle = open("TEST.$$$", O_WRONLY | O_CREAT | O_TRUNC,
<br> S_IREAD | S_IWRITE)) == -1)
<br> {
<br> printf("Error opening file.\n");
<br> exit(1);
<br> }
<br>
<br> strcpy(string, "Hello, world!\n");
<br> length = strlen(string);
<br>
<br> if ((res = write(handle, string, length)) != length)
<br> {
<br> printf("Error writing to the file.\n");
<br> exit(1);
<br> }
<br> printf("Wrote %d bytes to the file.\n", res);
<br>
<br> close(handle);
<br> return 0;
<br>}
<br>
<br>(<a href=http://www.fanqiang.com>http://www.fanqiang.com</a>)</font> 进入【<a href=http://www.chinaunix.net>UNIX论坛</a>】</td></tr><tr><td><hr></td></tr><tr><td><b>相关文章</b> </td></tr><tr><td><a href=/a4/b2/20011027/1305001515.html>C语言库函数(W类字母)</a> <small>(2001-10-27 13:05:00)</small></font><br><a href=/a4/b2/20011027/0905001514.html>C语言库函数(V类字母)</a> <small>(2001-10-27 09:05:00)</small></font><br><a href=/a4/b2/20011027/0805011513.html>C语言库函数(U类字母)</a> <small>(2001-10-27 08:05:01)</small></font><br><a href=/a4/b2/20011027/0705001512.html>C语言库函数(T类字母)</a> <small>(2001-10-27 07:05:00)</small></font><br><a href=/a4/b2/20011026/0900001511.html>C语言库函数(S类字母) - 3</a> <small>(2001-10-26 09:00:00)</small></font><br><a href=/a4/b2/20011026/0800011510.html>C语言库函数(S类字母) - 2</a> <small>(2001-10-26 08:00:01)</small></font><br><a href=/a4/b2/20011026/0700001509.html>C语言库函数(S类字母) - 1</a> <small>(2001-10-26 07:00:00)</small></font><br><a href=/a4/b2/20011025/0900011508.html>C语言库函数(R类字母)</a> <small>(2001-10-25 09:00:01)</small></font><br><a href=/a4/b2/20011025/0800031507.html>C语言库函数(Q类字母)</a> <small>(2001-10-25 08:00:03)</small></font><br><a href=/a4/b2/20011025/0700011506.html>C语言库函数(P类字母)</a> <small>(2001-10-25 07:00:01)</small></font><br></td></tr><tr><tr><td><br>===<a href=/cgi-bin/find.cgi?key=C语言库函数>更多相关</a>===</td></tr><td> </td></tr></table></td></tr><tr> <td width="100%" height="2" colspan="5" bgcolor="#D09F0D"><img src="/images/c.gif" width=1 height=1></td> </tr><tr> <td width="100%" height="40" colspan="5" valign=top><p align="center"><font color=#ffffff>★ 樊强制作 欢迎分享 ★ </font></p></td> </tr></table></center></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -