You are here

wherex in c

wherex function return current horizontal cursor position.

Declaration: int wherex();

C programming code for wherex

  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. main()
  5. {
  6.    int x;
  7.  
  8.    printf("Hello");
  9.  
  10.    x = wherex();
  11.  
  12.    printf("Horizontal cursor position from where this text appears = %d\n",x);
  13.  
  14.    getch();
  15.    return 0;
  16. }