gety

Overview :

The "gety" function is used to get the value of the current y co-ordinate in the current graphics mode and driver.

Syntax :
int gety();
Description :

The "gety" function has no parameters

  • The function can be called in grahics mode.

  • The function return the current value of the y co-ordinate



Example :
#include <stdio.h>
#include <conio.h>
#include <graphics.h>

int main()
{
    
   int gm,gd=DETECT,y;
   
   initgraph(&gd,&gm,"C:\\turboc3\\bgi");
   setcolor(10);
   
   y = gety();
   
   printf("\nThe current position is %d along y direction",y);
   
   moveto(200,200);
   
   y = gety();
   
   printf("\nNow the position is %d",y);
   
   getch();
   closegraph();
   return 0;
}

Comments

comments powered by Disqus