Web Developer wrote:[color=blue]
>[color=green][color=darkred]
> > > #include <iostream> is the Standard C++ way to include header files, the
> > > 'iostream' is an identifier that maps to the file iostream.h. In older[/color]
> > C++[color=darkred]
> > > you had to specify the filename of the header file, hence #include
> > > <iostream.h>. Older compilers may not recognise the modern method,[/color][/color]
> newer[color=green][color=darkred]
> > > compilers will accept both methods but the old method is obsolete.
> > >
> > > iostream.h became iostream
> > > fstream.h becams fstream
> > > vector.h became vector
> > > string.h became sting etc.
> > >[/color]
> >
> > Not true.
> >
> > string and string.h are both standard header files that do completely
> > different things.
> >
> > The other .h files are non-standard, it is not the case a compiler will
> > accept both.
> >
> > john[/color]
>
> I just like to add that the .h extension denotes a C header file, while the
> .hpp extension denotes a C++ header file. Maybe someone can clarify this?.
>[/color]
You need to understand that the extension is just a convention.
Whatever filename you plug into
#include "whatever"
will be pulled in by the preprocessor.
[color=blue]
> Side note: I assume a header file is like the import statement in Java?[/color]
It is an order to the preprocessor to replace the line containing #include
with the actual content of the specified file. Nothing more, nothing less.
--
Karl Heinz Buchegger
kbuchegg@gascad.at