📄 fw.htm
字号:
<HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"> <META NAME="Author" CONTENT="wdg"> <META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (Win95; I) [Netscape]"> <TITLE>fw</TITLE></HEAD><BODY> <BR> <BR> <P>函数名: wherex<BR>功 能: 返回窗口内水平光标位置<BR>用 法: int wherex(void);<BR>程序例:<P>#include <conio.h><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> return 0;<BR>}<BR> <BR> <BR> <P>函数名: wherey<BR>功 能: 返回窗口内垂直光标位置<BR>用 法: int wherey(void);<BR>程序例:<P>#include <conio.h><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> return 0;<BR>}<BR> <BR> <BR> <P>函数名: window<BR>功 能: 定义活动文本模式窗口<BR>用 法: void window(int left, int top, int right, int bottom);<BR>程序例:<P>#include <conio.h><P>int main(void)<BR>{<P> window(10,10,40,11);<BR> textcolor(BLACK);<BR> textbackground(WHITE);<BR> cprintf("This is a test\r\n");<P> return 0;<BR>}<BR> <BR> <BR> <P>函数名: write<BR>功 能: 写到一文件中<BR>用 法: int write(int handel, void *buf, int nbyte);<BR>程序例:<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>int main(void)<BR>{<BR> int handle;<BR> char string[40];<BR> int length, res;<P> /*<BR> Create a file named "TEST.$$$" in the current directoryand write<BR> a string to it. If "TEST.$$$" already exists,it will be overwritten.<BR> */<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> strcpy(string, "Hello, world!\n");<BR> length = strlen(string);<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> close(handle);<BR> return 0;<BR>}<BR> <P> <A HREF="index.html">返回目录</A><BR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -