Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>wherex() get horizontal position of cursor in text window</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 wherex()                Get Horizontal Position of Cursor in Text Window

 #include   <conio.h>

 int        wherex(void);

    wherex() returns the cursor's window-relative horizontal position (x-
    coordinate).

       Returns:     An integer value in the range of 1 to 80.

   Portability:     IBM PC and compatibles only.

   -------------------------------- Example ---------------------------------

    The following statements get the cursor's position in the current
    window.

           #include <conio.h>

           main()
           {
               window(40,1,80,25);
               cputs("Current Window\n");
               xcoord = wherex();
               ycoord = wherey();
               printf("Cursor is at: (%d,%d)",xcoord,ycoord);
           }


See Also: gettextinfo() gotoxy() wherey()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson