Saturday, April 6, 2013

moveto function in c

moveto function changes the current position (CP) to (x, y)
Declaration :- void moveto(int x, int y);

C programming code for moveto

#include <graphics.h>
#include <conio.h>
 
main()
{
   int gd = DETECT, gm;
   char msg[100];
 
   initgraph(&gd, &gm, "C:\\TC\\BGI");
 
   sprintf(msg, "X = %d, Y = %d",getx(),gety());
 
   outtext(msg);
 
   moveto(50, 50);
 
   sprintf(msg, "X = %d, Y = %d", getx(), gety());
 
   outtext(msg);
 
   getch();
   closegraph();
   return 0;
}

No comments:

Post a Comment