The "getx" function is used to get the value of the current x co-ordinate in the current graphics mode and driver.
int getx();
The "getx" function has no parameters
#include <stdio.h> #include <conio.h> #include <graphics.h> int main() { int gm,gd=DETECT,x; initgraph(&gd,&gm,"C:\\turboc3\\bgi"); setcolor(10); x = getx(); printf("\nThe current position is %d along x direction",x); moveto(100,100); x = getx(); printf("\nNow the position is %d",x); getch(); closegraph(); return 0; }