[Please do not mail me a copy of your followup]
bintom<
[email protected]> spake the secret code
On Turbo C++, the following program works:
#include<fstream.h>
#include<conio.h>
int main( )
{ cout<< "abc";
return 0;
}
It shouldn't work because you haven't brought namespace std into
scope.
Actually the headers <fstream.h> and <iostream.h> (and other in the form
<{standardname}.h>) used to exist in some implementations before they
supported the 'std' namespace (or before the 'std' namespace was even
introduced for all standard declarations). Turbo C++ is one of those
implementations, I am guessing.
Furthermore, the headers should be<fstream> and<iostream> and not
Because<iostream> is the standard header that declares std::cout.
See "C++ Standard Library" by Nicolai Josuttis for an excellent
reference on the standard library.<
http://tinyurl.com/josuttis>
Again, Dev C++ version the OP has *may* still contain non-standard
headers with standard names yet with .h extension, and they can either
have explicit 'using namespace std;' after including the corresponding
standard header or just contain everything like the standard one only
without the 'std' namespace.
To the OP: get the book Richard recommended and learn to use *only* the
standard headers for the *standard* elements (classes, objects,
functions, etc.) You will undoubtedly need non-standard stuff, but
stick to the book's style and you're gonna be OK.
V