Results 1 to 9 of 9

Thread: #include the .h

  1. #1

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    #include the .h

    when you include files wats the difference between

    #include <iostream>
    and
    #include <iostream.h>

    parksie is it differnet verson or a compiler issue?

    Thanks

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    The old (C) way is #include "iostream.h". Saying #include <iostream.h>, I believe, loads the 'old' iostream. Just <iostream> will load the C++ one. I think the same can also be done by <ciostream>; if such a header exists, it would be the C iostream header, not the C++.

    But I'm probably totally wrong!
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3
    Lively Member FantastichenEin's Avatar
    Join Date
    Mar 2000
    Location
    dairy
    Posts
    106
    iostream.h is the old iostream library, it's depreciated now and only there for backwards compatabilty.

    iostream is part of the c++ standard library, so use this one.
    ****

  4. #4
    Lively Member FantastichenEin's Avatar
    Join Date
    Mar 2000
    Location
    dairy
    Posts
    106
    there is no ciostream as it isn't part of standard C
    ****

  5. #5

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099
    btw whats a header file, is it like a list of constants or some thing??


    Thanks

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It's just a file you include wholesale. It might have preprocessor definitions, constants, class definitions, function prototypes, template functions, loads of stuff.

    FE: Deprecated, not depreciated (subtle difference, check a dictionary )
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    Lively Member FantastichenEin's Avatar
    Join Date
    Mar 2000
    Location
    dairy
    Posts
    106
    I think that iostream and iostream.h are incompatible i.e. you cannot mix methods from both. Is this correct?
    ****

  8. #8
    Lively Member FantastichenEin's Avatar
    Join Date
    Mar 2000
    Location
    dairy
    Posts
    106

    FE: Deprecated, not depreciated (subtle difference, check a dictionary )
    You live and learn...
    ****

  9. #9
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Originally posted by FantastichenEin
    I think that iostream and iostream.h are incompatible i.e. you cannot mix methods from both. Is this correct?
    Correct. In fact, mixing iostream.h and a lot of things from the Standard Library is asking for trouble. For example, with <iostream>, you can do cout << string("blah") << endl. <iostream.h> doesn't recognise the string class, and can't.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width