Mail Archives: djgpp/1997/04/09/08:11:11
dabrownz AT mindspring DOT com wrote:
> How do you center printf text on a DOS screen? I can't find anyway to
> do this other than using tabs and spaces (very annoying). What is the
> 'correct' way to do it? Do I have to use 'cprintf' or some other
> keyword or include another library? I'd would really appriciate any
> help, Thanks.
printf has no functionality for this. cprintf (a function, by the way, not
a keyword) doesn't either, as far as I know.
Probably the best solution is to write a centering function, which, when
passed a string and a width, will center that string in the width (or clip
it if it won't fit). This is quite simple.
--
Erik Max Francis, &tSftDotIotE / email: max AT alcyone DOT com
Alcyone Systems / web: http://www.alcyone.com/max/
San Jose, California, United States / icbm: 37 20 07 N 121 53 38 W
\
"E pur, / sic muove!"
/ Galileo Galilei
- Raw text -