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

    int gprintf(int x, int y, char *fmt, ...) 
        { 
        int len; 
        char buf[100]; 
        va_list args; 

        va_start(args, fmt); 

        len = vsprintf(buf, fmt, args); 
        outtextxy(x, y, buf); 

        va_end(args); 
        return len; 
        } 

    void main() 
        { 
        int driver=DETECT, mode; 
        initgraph(&driver, &mode, "c:/tc/bgi"); 
        gprintf(100, 200, "Driver=%d, Mode=%d.", driver, mode ); 
        getch(); 
        closegraph(); 
        } 

