textwidth function returns the width of a string in pixels.
Declaration :- int textwidth(char *string);
Declaration :- int textwidth(char *string);
C programming source code for textwidth
#include<graphics.h> #include<conio.h> main() { int gd = DETECT, gm, width; char array[100]; initgraph(&gd, &gm, "C:\\TC\\BG I"); width = textwidth("C programming"); sprintf(array,"Textwidth = %d",width); outtext(array); getch(); closegraph(); return 0; }
No comments:
Post a Comment