The difference is likely not in angle brackets vs quotes. Note how in
one case the file name is fstream.h, and in the other it's just fstream.
The former was used in VC6 and earlier, was deprecated in VC6 and was
removed in subsequent version. The latter (fstream without an extension)
is modern, standard-conformant header file name.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
thanks Igor :)
Several things here:
1. The C++ standard defines a bunch of headers (e.g. 'fstream'
and 'iostream'). Those are included with #include <fstream>. Everything
else, like e.g. windows.h is not a C++ header. Note also that C++ doesn't
require these headers to actually be implemented as files, it could be some
compiler-internal data structure activated there.
2. In order to include a file in another file, C++ says you should use
#include "otherfile", e.g. #include "my class.h".
3. The distinction that C++ makes about headers is traditionally blurred.
That means that 'system' header files are also usually included with angled
brackets like #include <windows.h>. This is incorrect as far as C++ is
concerned but established practice.
4. For your own header files (i.e. those that are part of the project in
question), you should use the "" syntax and make the filenames end
with '.h' or '.hpp'.
5. 'fstream.h' is not a part of C++. This is a header of the old,
pre-standard IOStreams library. The IOStreams in the C++ standard are
templates and they all live in namespace std, so the contents
of 'fstream.h' and 'fstream' are not the same though they are similar. Do
not use fstream.h and be cautious of code that does!
Uli
And the correct line is therefore:
#include <fstream>
"The difference between the two forms is the order in which the preprocessor
searches for header files when the path is incompletely specified."
There's a table there that shows the search orders for the two forms of
#include.
Just FYI,
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
"Christian" <voodoo8...@gmail.com> wrote in message
news:8ee75de5-f21f-4a80...@i12g2000prf.googlegroups.com...