You are here

getx function in C

The function getx returns the X coordinate of the current position.

Declaration: int getx();

C program of getx

#include <graphics.h>
#include <conio.h>

main()
{
   int gd = DETECT, gm;
   char array[100];

   initgraph(&gd, &gm, "C:\\TC\\BGI");

   sprintf(array, "Current position of x = %d", getx());

   outtext(array);

   getch();
   closegraph();
   return 0;
}