just checking...

This is a discussion on just checking... within the C++ Programming forums, part of the General Programming Boards category; Is there a way to center output... Code: cout << setiosflags(ios::left) << setw(5) << 'x' << endl; there's a way ...

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    153

    just checking...

    Is there a way to center output...
    Code:
    cout << setiosflags(ios::left) << setw(5) << 'x' << endl;
    there's a way to left justify and it right jutifies by default...any way to center?

  2. #2
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    not any standard way that I know of at least... your best solution may be to write it to a character array or String and then output that. you'd have to use a little math to get it centered in the string though.

    here's a list of the standard manipulators and stream flags: http://www.cppreference.com/io_flags.html#format_flags
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Array bounds checking
    By rohan_ak1 in forum C Programming
    Replies: 2
    Last Post: 08-26-2008, 10:16 PM
  2. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  3. Interpreter.c
    By moussa in forum C Programming
    Replies: 4
    Last Post: 05-28-2008, 05:59 PM
  4. Forced moves trouble!!
    By Zishaan in forum Game Programming
    Replies: 0
    Last Post: 03-27-2007, 06:57 PM
  5. Problems about gcc installation
    By kevin_cat in forum Linux Programming
    Replies: 4
    Last Post: 08-09-2005, 09:05 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21