wherex

Returns the horizontal position of the input cursor

Local Servers:nonblocking
Remote Servers:N/A
Classification:3.x, 4.x, 5.x, 6.x
Service:Screen Handling

Syntax

  #include <nwconio.h>  
   
  WORD wherex  (void); 
  

Return Values

This function returns the current column of the input cursor if successful. If an error occurs, it returns EFAILURE.

If an error occurs, errno is set to:

Value

Hex

Name

Description

23

(0x17)

ENO_SCRNS

Screen I/O was attempted when no screens were open.

Remarks

The wherex function returns the x coordinate of the current input cursor position (within the current screen). It also returns the output cursor’s position if cursor coupling for the current screen is enabled.

See Also

SetPositionOfInputCursor, wherey

Example

  #include <stdlib.h>  
  #include <nwconio.h>  
  #include <stdio.h> 
    
  main()  
  {  
     printf("%d,%d\r\n",wherex(),wherey());  
     getch();  
  }