Thread: Depreciated/antiquated iostream.h

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    2

    Depreciated/antiquated iostream.h

    Im having a little trouble with iostream.h.
    Compiler (Dev-C++), Tells me my iosrteam.h is antiquated.
    Bear with me i started this about 12 hours ago.

    Code:
    #include <iostream.h>
    int main()
    {
        int a;
        cout<<"Simple Test file";
        cout<<"Punch in a random Number: ";
        cin>>a;
        cout<<"You entered: "<<a;
        return 0;
    }
    also, how do you make the dos box stay untill an "Anykey" event, without opening it manually through the box
    Thanks
    Last edited by ThePyro; 04-26-2004 at 07:18 AM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    That's the old way - hence it is deprecated

    The new way is to begin your programs with
    Code:
    #include <iostream>    // Note, no .h
    using namespace std;  // all your small programs will only use the std namespace
    > Also, is Break; the tag for a new line, if not, what is?
    It's a keyword used to break out of loops
    Since you're not in a loop at that point in the code, it is a coding error.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    2
    Sorry i didn't make an edit fast enough, i figured out the break thing on my own.
    how do you make the dos box stay untill an "Anykey" event, without opening it manually through the box.
    and what is the new line command, so you dont end up with the 2 "Cout"s on the same line

  4. #4

  5. #5
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    > and what is the new line command, so you dont end up with the 2 "Cout"s on the same line

    Add a \n character to your string. However, this does not flush the stream. It is always good practice to flush your streams when you want data to show up on the screen.
    Code:
    cout << "Hello\n"; // doesn't flush
    cout << "Hello\n" << flush; // ok
    cout << "Hello" << endl; // *recommended way*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. iostream.h
    By SirCrono6 in forum C++ Programming
    Replies: 4
    Last Post: 02-03-2006, 01:23 AM
  2. Including iostream.h
    By DvdHeijden in forum C++ Programming
    Replies: 7
    Last Post: 01-15-2005, 12:23 PM
  3. iostream.h (vs) iostream
    By Brain Cell in forum C++ Programming
    Replies: 5
    Last Post: 11-05-2004, 08:20 AM
  4. iostream.h problems
    By UniqueScreenNam in forum C++ Programming
    Replies: 9
    Last Post: 11-11-2002, 12:34 PM
  5. stdio.h vs iostream.h
    By Hiroyuki in forum C Programming
    Replies: 2
    Last Post: 03-13-2002, 09:21 PM