- #include <windows.h>
- #include <stdio.h>
- #include <conio.h>
-
- void main()
- {
- POINT pt;
- int x0,y0,x1,y1;
- GetCursorPos(&pt);
- x0=pt.x;
- y0=pt.y;
- clrscr();
- printf("%d , %d",pt.x, pt.y);
- while(!kbhit())
- {
- GetCursorPos(&pt);
- x1=pt.x;
- y1=pt.y;
- if ((x0==x1) && (y0==y1)) {;}
- else{
- clrscr();
- gotoxy(1,1);
- printf("%d , %d",pt.x, pt.y);
- }
- x0=x1;
- y0=y1;
- }
- printf("\n");
- system("pause");
- }
#include <windows.h>
#include <stdio.h>
#include <conio.h>
void main()
{
POINT pt;
int x0,y0,x1,y1;
GetCursorPos(&pt);
x0=pt.x;
y0=pt.y;
clrscr();
printf("%d , %d",pt.x, pt.y);
while(!kbhit())
{
GetCursorPos(&pt);
x1=pt.x;
y1=pt.y;
if ((x0==x1) && (y0==y1)) {;}
else{
clrscr();
gotoxy(1,1);
printf("%d , %d",pt.x, pt.y);
}
x0=x1;
y0=y1;
}
printf("\n");
system("pause");
}