Declarations:
int getx();
int gety();
Function getx returns the X coordinate of the current position.
Function gety returns the Y coordinate of the current position.
Example program of getx and gety functions:
#include <conio.h>
#include <stdlib.h>
int main()
{
int gd = DETECT, gm;
int x, y;
char a[100];
initgraph(&gd,&gm,"C:\\TC\\BGI");
moveto(200 + random(100),100 + random(100));
circle(getx(), gety(), 50);
getch();
closegraph();
return 0;
}
Note: Current Position is sometimes written as CP in short.