摘自TC帮助文件
wherex, wherey
<CONIO.H>
wherex gives current horizontal cursor position
wherey gives current vertical cursor position
Declaration:
int wherex(void);
int wherey(void);
Remarks:
wherex returns the x-coordinate of the current cursor position (within the
current text window).
wherey returns the y-coordinate of the current cursor position (within the
current text window).
Return Value:
wherex returns an integer in the range 1 to 80.
wherey returns an integer in the range 1 to 25,
1 to 43, or 1 to 50.
Portability:
DOS UNIX ANSI C C++ Only
Yes
See Also:
gettextinfo
gotoxy
Example:
#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;
}