i need to center text in a field that is 50 characters wide ....... this is for a school project, so it has to be centered using iosflags since that is the only way the teacher has tought us how to do it.
~thanks~
i need to center text in a field that is 50 characters wide ....... this is for a school project, so it has to be centered using iosflags since that is the only way the teacher has tought us how to do it.
~thanks~
To my knowledge, you cannot center text using ios flags. Try something like this:
Code:void Center(string &text, ostream &of) { for (int i = 0; i < 50 - text.length(); i++) of.put(' '); of << text; }
Last edited by Eibro; 11-10-2002 at 03:31 PM.