getx function of c graphics

getx function is used to get the current position of x coordinate on screen. We can set the current position of cursor by using moveto function

General syntax for getx function is:
                                          getx( );

C graphics program to demonstrate getx function.


#include <graphics.h>
#include <stdio.h>



int main( )
{
    int gd=DETECT, gm;
    char msg[50];
    initgraph(&gd,&gm,"C:\\tc\\bgi");

    moveto(200,160);
    sprintf(msg,"Current position of X: %d",getx());
    outtext(msg);

    getch();
    closegraph();

    return 0;
}
getx function of c graphics

Download


0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.