when you include files wats the difference between
#include <iostream>
and
#include <iostream.h>
parksie is it differnet verson or a compiler issue?
Thanks :)
Printable View
when you include files wats the difference between
#include <iostream>
and
#include <iostream.h>
parksie is it differnet verson or a compiler issue?
Thanks :)
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!
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.
there is no ciostream as it isn't part of standard C
btw whats a header file, is it like a list of constants or some thing??
Thanks
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 think that iostream and iostream.h are incompatible i.e. you cannot mix methods from both. Is this correct?
You live and learn...Quote:
FE: Deprecated, not depreciated (subtle difference, check a dictionary ;))
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.Quote:
Originally posted by FantastichenEin
I think that iostream and iostream.h are incompatible i.e. you cannot mix methods from both. Is this correct?