On 25 Aug 2004 05:13:38 -0700,
sp*****@pandora .be (TuPLaD) wrote:
#include "iostream"
I was about to post to tell the OP to use #include <iostream>
instead of #include "iostream", but after I saw that neither Rolf
nor Sharad reacted, I hesitated. I tried it, and indeed my
compiler didn't complain. Yet I was under the impression that
standard headers should be included with square brackets.
Stroustrup 9.2.1 says that for standard headers square brackets
should be used rather than quotes, but I couldn't figure out if
it is mandatory or just some guideline.
If I remember correctly, #include "somefile.h " means:
1) first search for somefile.h in the current directory, and if
that fails
2) search the system directories.
This would explain why my compiler accepted it.
However, #include <iostream> does not mean that there must be a
file called iostream: the name may be different, or there may be
no file at all, depending on the compiler.
Hence I believe that #include "iostream" may work on one
compiler, but is not portable, and should be avoided.
Did I miss something?
--
Andre Heinen
My address is "a dot heinen at europeanlink dot com"