Quote Originally Posted by erikkonstas View Post
Hm, can you mention why you'd want to do this? The text "width" you're talking about depends completely on the font the text is written in; for example, on a terminal, the font will most likely be monospaced, so all printable ASCII characters will have the same width.
Yes. You need to know what font your output device is using.
Standard C has no functions for querying a font, but your platform will. Since getting the width of a string is such a common requirement, there will almost certainly be a function which does this directly. The hard part is often specifying the font.