need a good explanation

Discussion in 'C++' started by Anarki, Jun 26, 2008.

  1. Anarki

    Anarki Guest

    what are the differences between

    1) #include <iostream.h>

    2) #include <iostream>
    using namespace std;
     
    Anarki, Jun 26, 2008
    #1
    1. Advertising

  2. Anarki

    Martin York Guest

    On Jun 25, 10:11 pm, Anarki <> wrote:
    > what are the differences between
    >
    > 1)  #include <iostream.h>

    This was valid before the STL became standard.
    After standardization it is no longer valid. Some compilers support it
    but only for backwards computability, as a result any code using this
    is not very portable.


    >
    > 2) #include <iostream>
    >     using namespace std;


    This is part of the STL.
    All items in the STL are in the std namespace.
     
    Martin York, Jun 26, 2008
    #2
    1. Advertising

  3. Anarki wrote:
    > what are the differences between
    >
    > 1) #include <iostream.h>
    >
    > 2) #include <iostream>
    > using namespace std;


    Both are equally bad ways of saying:

    #include <iostream>
     
    Juha Nieminen, Jun 26, 2008
    #3
  4. Anarki

    kamit Guest

    As others have mentioned use #include <iostream> and NOT #include
    <iostream.h>.

    Case 1: #include <iostream>
    Here everything is wrapped under the namespace std;


    Case 2: #include <iostream.h>
    Here everything is under global namespace.

    HTH.

    On Jun 26, 6:18 am, Juha Nieminen <> wrote:
    > Anarki wrote:
    > > what are the differences between

    >
    > > 1)  #include <iostream.h>

    >
    > > 2) #include <iostream>
    > >     using namespace std;

    >
    >   Both are equally bad ways of saying:
    >
    > #include <iostream>
     
    kamit, Jun 26, 2008
    #4
  5. Anarki

    Jerry Coffin Guest

    In article <>,
    says...
    >
    > "Anarki" <> wrote in message
    > news:...
    > > what are the differences between
    > >
    > > 1) #include <iostream.h>
    > >
    > > 2) #include <iostream>
    > > using namespace std;

    >
    > The second is standard C++, the first is not.
    > None of the C++ standard headers contain ".h"
    > in their names.


    ....except the deprecated ones in part 5 of Appendix D.

    --
    Later,
    Jerry.

    The universe is a figment of its own imagination.
     
    Jerry Coffin, Jun 27, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kaladhaur Palaniappa

    Need Explanation

    Kaladhaur Palaniappa, Aug 7, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,028
    Kaladhaur Palaniappa
    Aug 7, 2003
  2. Dave
    Replies:
    4
    Views:
    408
  3. darrel
    Replies:
    0
    Views:
    418
    darrel
    Oct 20, 2004
  4. a good explanation

    , May 25, 2006, in forum: Python
    Replies:
    7
    Views:
    319
    Diez B. Roggisch
    May 26, 2006
  5. Dark Ambient
    Replies:
    2
    Views:
    97
    Jim Cochrane
    Jul 22, 2006
Loading...

Share This Page