getx() function is used to fetch the X-coordinate of the current position.
- For better understanding go through the program:
int gd=DETECT, gm,x;
sprintf(a,”current position of X coordinate is %d”,x);
Above program would display the current position of X-coordinate. It shows a message like “current position of X coordinate is —“.