Depreciated/antiquated iostream.h

This is a discussion on Depreciated/antiquated iostream.h within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Im having a little trouble with iostream.h. Compiler (Dev-C++), Tells me my iosrteam.h is antiquated. Bear with me i started ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,422
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789

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

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