what the difference between them?!
i know when we write <iostream> we have to put:
using std::cout;
using std::cin;
and so on, but is there any other difference?!
what the difference between them?!
i know when we write <iostream> we have to put:
using std::cout;
using std::cin;
and so on, but is there any other difference?!
<iostream.h> and the old style headers are deprecated under the c++ standard.......so they are legal, but wond be supported in the future........try to stick with <iostream>
Follow the c++-standard and use
Itīs more portable. E.i different compiler use different file-extentions (for header files) and if you use #include this way you your code will not be "compiler-dependet".Code:#include <iostream>
Last edited by ripper079; 11-18-2002 at 09:59 AM.
Fordy is correct its about that darn ISO/ANSI standards. <iostream> is thee newest and its technically correct vs. the other even though both are correct.Originally posted by Lazy Student
what the difference between them?!
i know when we write <iostream> we have to put:
using std::cout;
using std::cin;
and so on, but is there any other difference?!
In a nutshell...one is outdated as far as stardards and the ohthwer isnt.
Hope this helps!
cj
"Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
-Bruce Lee
whats really the point of changing it if it worked fine before? i mean, does it really matter that you have ".h" after iostream? or is there something else that it does?
<iostream.h> is considered depreciated under modern C++. the only difference between the two is that the members of <iostream> are declared in the namespace std where as the members of <iostream.h> are declared outside of namespace (because <iostream.h> is from an earlier era where namespaces did not exist)
hello, internet!
oh, ok. it has <iostream.h> on the tut at the cprogramming site, so it must have been written a little while ago i guess.
namespace std is not the only difference. There are other more subtle differences.
Use the newer header if your compiler has it. If not get a new compiler.The old .h headers are their for legacy code compatability thats all.Treat them as if they are not meant for use in c++. Eventually support for the old style headers may be dropped then compilers will not have to provide them.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
<iostream> is the newer version, and you can more easily use it by doing this:
#include <iostream>
using namespace std;
and you can use it the same as <iostream.h>.
From what I heard, they created the updated <iostream> to ........ off microsoft, windows gui users can't double click on a file without an extension.
And they kept iostream.h so compilers would be compatible and be able to compile code using it with the .h extension.
but the two are different, just check the source.