Saturday, April 6, 2013

textheight function in c

textheight function returns the height of a string in pixels.
Declaration :- int textheight(char *string);

C programming source code for textheight

#include<graphics.h>
#include<conio.h>
 
main()
{
    int gd = DETECT, gm, height;
    char array[100];
 
    initgraph(&gd, &gm, "C:\\TC\\BGI");
 
    height = textheight("C programming");
 
    sprintf(array,"Textheight = %d",height);
    outtext(array);
 
    getch();
    closegraph();
    return 0;
}

No comments:

Post a Comment