textheight() function in C
Last Updated :
23 Jan, 2018
The header file graphics.h contains textheight() function which returns the height of input string in pixels.
Syntax :
int textheight(char *string);
Example :
Input : string = "Hello Geek ! Have a good day."
Output :
Below is the implementation of textheight() function.
#include <graphics.h>
#include <stdio.h>
int main()
{
int gd = DETECT, gm, color, height;
char arr[100];
initgraph(&gd, &gm, "" );
height = textheight( "Hello Geek ! Have a good day." );
sprintf (arr, "Textheight is = %d" , height);
outtext(arr);
getch();
closegraph();
return 0;
}
|
Output :
Share your thoughts in the comments
Please Login to comment...