RAD Studio
ContentsIndex
PreviousUpNext
wherex

Header File 

conio.h  

Category 

Console I/O Routines 

Prototype 

int wherex(void); 

Description 

Gives horizontal cursor position within window.

Note: Do not use this function in Win32 GUI applications.
wherex returns the x-coordinate of the current cursor position (within the current text window). 

Return Value 

wherex returns an integer in the range 1 to the number of columns in the current video mode. 

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;
}

Portability

POSIX 
Win32 
ANSI C 
ANSI C++ 
 
 
 
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!