Quote:
Originally Posted by Ancient Dragon
If you use MFC there is a CDC c++ class that will help you with that centering. There is also the win32 api function TextOut() But you have to know where you want the text to start (x and y coordinates). That will depend on the font and font size being used. If you navigate through some of the links in MSDN you will probably find some example(s) you can use.
|
hey thanks for the reply, im using linux, i was hoping that there was a function in the standard library that comes with C++. its a pretty simple concept, and it is a console based application. sorry i didnt give enough information in the first place. i have a simple algorithm that centers it, but its based on a fixed width, i.e running it in a tty terminal it will be centered, but when running it in a gui based terminal i.e gnome terminal or kterm, it will not be centered.