int far textwidth(char far *str)
Прототип:
Описание:
Функция textwidth() возвращает ширину (в пикселах) строки, на которую указывает параметр str, применительно к текущему шрифту и его размеру.
Пример:
Следующая программа выводит значение 40 в качестве ширины строки «hello» в пикселах:
#include <stdio.h>
#include <graphics.h>
#include <conio.h>
int main(void)
{
int driver, mode;
driver = DETECT; /* автоопределение */
mode = 0;
initgraph(&driver, &mode, "c:\\bc5\\bgi");
printf("width: %d", textwidth("hello"));
getch();
restorecrtmode();
return 0;
}
#include <stdio.h>
#include <graphics.h>
#include <conio.h>
int main(void)
{
int driver, mode;
driver = DETECT; /* автоопределение */
mode = 0;
initgraph(&driver, &mode, "c:\\bc5\\bgi");
printf("width: %d", textwidth("hello"));
getch();
restorecrtmode();
return 0;
}