Thread: Newbie Question...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    11

    Unhappy Newbie Question...

    I'm trying to write a program that displays output in columns, but I can't figure out how to set the width or anything like that with the cout command. I think there is a command like setwidth() or something, but I'm really not too sure. If anyone can understand what I'm asking and possibly help out, I'd REALLY appriciate it.

    - Adian

  2. #2
    Unregistered
    Guest

    Exclamation

    I am pretty sure that what you are looking for is this:

    cout.width(the_required_width_as_int);

    this will help you format your output.

    there are other useful functions such cout.precision() and cout.fill();

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    11

    Thanks

    Thanks a lot, that's exactly what I was looking for.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stupid Newbie question
    By TimL in forum C++ Programming
    Replies: 4
    Last Post: 07-22-2008, 04:43 AM
  2. C prog newbie question
    By Draginzuzu in forum C Programming
    Replies: 1
    Last Post: 02-03-2003, 06:45 PM
  3. a stupid question from a newbie
    By newcomer in forum C++ Programming
    Replies: 4
    Last Post: 01-11-2003, 04:38 PM
  4. confusion with integers (newbie question)
    By imortal in forum C Programming
    Replies: 7
    Last Post: 12-06-2002, 04:09 PM
  5. newbie class templates question
    By daysleeper in forum C++ Programming
    Replies: 2
    Last Post: 09-18-2001, 09:50 AM