the '#' sign in C++ coding

Hi all,

Look at this directive line,

#include "iostream.h" or <iostream.h>

What that '#' sign means? And why we need to write it in such lines? And why Stroustrup added it to C++?

Thanks.
The hash sign # is used mostly in preprocessor directives.

The preprocessor is a utility which examines the source code, doing a number of things (out of which probably the most important):
1) copy-pastes headers
2) expands macros

Read more here:
http://en.cppreference.com/w/cpp/preprocessor
http://en.cppreference.com/w/cpp/language/translation_phases
Here's a fun fact. The # being used to indicate a preprocessor directive is something taken from C. Stroustrup didn't add that feature in.

Also, the correct include for the iostream header is <iostream>, not <iostream.h>. Just so you know.

-Albatross
OK mate, thanks for both of you mates.
Topic archived. No new replies allowed.