You are here

Function wherex in C

Function wherex returns the current horizontal cursor position.

Declaration: int wherex();

C program for wherex

#include <stdio.h>
#include <conio.h>

int main()
{
   int p;

   printf("Hello");

   p = wherex();

   printf("Horizontal cursor position from where this text appears = %d\n", p);

   getch();
   return 0;
}

Share this