Thread: Question about <iomanip.h>

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    5

    Question Question about <iomanip.h>

    does anyone know what header file <iomanip.h> is exactly? i'm using Turbo C++ but i don't see that file listed anywhere, and i have gotten a lot of help from different people but most of them include that header file in their explanations.

    so i would appreciate if someone could tell me what is in it, or where i could find a copy of it and an explanation.

    thanks

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    That is the Input/Output MANIPulator header. It declares stream manipulators that you can use in your programs. Stream manipulators are a sometimes handy way of doing things that would otherwise necessitate you using a stream's member functions to accomplish. For example, to set the stream's width to 10 and then display a variable's value you could either use:
    Code:
    cout.width(10);
    cout << variable_name;
    Or you could use a stream manipulator and get everything on one line like so:
    Code:
    cout << setw(10) << variable_name;
    The compiler you are talking about might not have this header file. I usually use MSVC++ 6.0 and I know that it is available under that compiler. Like I have in my first example, there are usually ways to accomplish the same thing as what is being done with a stream manipulator but using the stream's own member functions instead. What is it that you are trying to accomplish here?
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  2. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  3. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  4. Question about linked lists.
    By cheeisme123 in forum C++ Programming
    Replies: 6
    Last Post: 02-25-2003, 01:36 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM