Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,986 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,404 people online right now. Registration is fast and FREE... Join Now!




centering output

 
Reply to this topicStart new topic

centering output

Umbrella
22 Nov, 2006 - 04:45 PM
Post #1

New D.I.C Head
*

Joined: 13 Oct, 2006
Posts: 49


My Contributions
I heard there was a tag that will center, left and right justify my output.

is this true, if so...could you provide syntax to do so .
User is offlineProfile CardPM
+Quote Post

BitByte
RE: Centering Output
22 Nov, 2006 - 04:52 PM
Post #2

D.I.C Head
**

Joined: 9 Aug, 2006
Posts: 194



Thanked: 3 times
My Contributions
There is setw() or there is:

CODE
cout.setf( ios_base::left )
cout.setf( ios_base::right )
cout.setf( ios_base::internal )


They are a bit fiddly to get the proper layout you want, trial and error.
User is offlineProfile CardPM
+Quote Post

Umbrella
RE: Centering Output
22 Nov, 2006 - 05:12 PM
Post #3

New D.I.C Head
*

Joined: 13 Oct, 2006
Posts: 49


My Contributions
I was also wondering if there was a way i could set the size of the command prompt to a default value. So the size of the command prompt will always be the same.

maybe even a full screen...
User is offlineProfile CardPM
+Quote Post

BitByte
RE: Centering Output
22 Nov, 2006 - 05:17 PM
Post #4

D.I.C Head
**

Joined: 9 Aug, 2006
Posts: 194



Thanked: 3 times
My Contributions
Here is a link to some things to do with the console:

Console Stuff

But you must remember they are only for windows, so if you are writing programs for other platforms they will not work.
User is offlineProfile CardPM
+Quote Post

Umbrella
RE: Centering Output
22 Nov, 2006 - 05:19 PM
Post #5

New D.I.C Head
*

Joined: 13 Oct, 2006
Posts: 49


My Contributions
yea im aware just for my own amusement really haha..
User is offlineProfile CardPM
+Quote Post

Umbrella
RE: Centering Output
22 Nov, 2006 - 05:40 PM
Post #6

New D.I.C Head
*

Joined: 13 Oct, 2006
Posts: 49


My Contributions
very kewl stuff thank you!
User is offlineProfile CardPM
+Quote Post

okyup
RE: Centering Output
22 Nov, 2006 - 06:32 PM
Post #7

D.I.C Head
Group Icon

Joined: 6 Nov, 2006
Posts: 207


Dream Kudos: 175
My Contributions
QUOTE(BitByte @ 22 Nov, 2006 - 06:17 PM) *

Here is a link to some things to do with the console:

Console Stuff

But you must remember they are only for windows, so if you are writing programs for other platforms they will not work.


Interesting link! smile.gif
User is offlineProfile CardPM
+Quote Post

ladyone
RE: Centering Output
15 Mar, 2008 - 08:56 PM
Post #8

New D.I.C Head
*

Joined: 15 Mar, 2008
Posts: 1

QUOTE(Umbrella @ 22 Nov, 2006 - 05:45 PM) *

I heard there was a tag that will center, left and right justify my output.

is this true, if so...could you provide syntax to do so .



This is ladyone and I will try your suggestions for centering text in code. Thank you.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 07:30PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month