You are here

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

  1. #include<graphics.h>
  2. #include<conio.h>
  3.  
  4. main()
  5. {
  6.     int gd = DETECT, gm, height;
  7.     char array[100];
  8.  
  9.     initgraph(&gd, &gm, "C:\\TC\\BGI");
  10.  
  11.     height = textheight("C programming");
  12.  
  13.     sprintf(array,"Textheight = %d",height);
  14.     outtext(array);
  15.  
  16.     getch();
  17.     closegraph();
  18.     return 0;
  19. }