need a good explanation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anarki

    need a good explanation

    what are the differences between

    1) #include <iostream.h>

    2) #include <iostream>
    using namespace std;


  • Martin York

    #2
    Re: need a good explanation

    On Jun 25, 10:11 pm, Anarki <Deepchan...@gm ail.comwrote:
    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.

    Comment

    • Mike Wahler

      #3
      Re: need a good explanation


      "Anarki" <Deepchand.P@gm ail.comwrote in message
      news:5dca8d5a-810f-4c52-9356-7bfedaf8ab60@w4 g2000prd.google groups.com...
      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.

      -Mike


      Comment

      • Juha Nieminen

        #4
        Re: need a good explanation

        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>

        Comment

        • kamit

          #5
          Re: need a good explanation

          As others have mentioned use #include <iostreamand 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 <nos...@thanks. invalidwrote:
          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>

          Comment

          Working...