📄 fw.htm
字号:
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=gb_2312-80">
<meta name="Author" content="wdg">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>网上学堂 --> C语言编程宝典之一 -->函数名: w</title>
</head>
<body>
<div align="center"><center>
<table border="1" cellpadding="4" width="640"
bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF">
<tr>
<td bgcolor="#FFE6B0" bordercolor="#8080FF" class="p9"><font
color="#BB0000">导航条:--></font> <a
href="../../index.html">网上学堂</a> --> <a
href="../tcindex.htm"><font face="宋体">C</font>语言编程宝典之一</a>
-->函数名: w</td>
</tr>
<tr>
<td bordercolor="#8080FF" class="p9"><p>函数名: wherex
<br>
功 能: 返回窗口内水平光标位置 <br>
用 法: int wherex(void); <br>
程序例: </p>
<p>#include <conio.h> </p>
<p>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(); </p>
<p> return 0; <br>
} <br>
<br>
<br>
</p>
<p>函数名: wherey <br>
功 能: 返回窗口内垂直光标位置 <br>
用 法: int wherey(void); <br>
程序例: </p>
<p>#include <conio.h> </p>
<p>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(); </p>
<p> return 0; <br>
} <br>
<br>
<br>
</p>
<p>函数名: window <br>
功 能: 定义活动文本模式窗口 <br>
用 法: void window(int left, int top, int right,
int bottom); <br>
程序例: </p>
<p>#include <conio.h> </p>
<p>int main(void) <br>
{ </p>
<p> window(10,10,40,11); <br>
textcolor(BLACK); <br>
textbackground(WHITE); <br>
cprintf("This is a test\r\n"); </p>
<p> return 0; <br>
} <br>
<br>
<br>
</p>
<p>函数名: write <br>
功 能: 写到一文件中 <br>
用 法: int write(int handel, void *buf, int
nbyte); <br>
程序例: </p>
<p>#include <stdio.h> <br>
#include <stdlib.h> <br>
#include <fcntl.h> <br>
#include <sys\stat.h> <br>
#include <io.h> <br>
#include <string.h> </p>
<p>int main(void) <br>
{ <br>
int handle; <br>
char string[40]; <br>
int length, res; </p>
<p> /* <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>
*/ </p>
<p> 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>
} </p>
<p> strcpy(string, "Hello,
world!\n"); <br>
length = strlen(string); </p>
<p> 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); </p>
<p> close(handle); <br>
return 0; <br>
} </p>
</td>
</tr>
</table>
</center></div><div align="center"><center>
<table border="0" cellspacing="1" width="640">
<tr>
<td class="p9" height="60"> <script>document.write("<p><a href=\"http://view.gznet.com/cgi-bin/rl_views.cgi?UID=10013421\" target=sxrl>");
document.write("<img src=\"http://refer.gznet.com/cgi-bin/rl_refer2.cgi?UID=10013421&refer="+escape(top.document.referrer)+"\" width=1 height=1 border=0 alt=\" \">");
document.write("</a>");
</script></td>
</tr>
</table>
</center></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -