What is the difference between using #include
The #include was common in C++ code prior to the C++ standard. The standard changed it to #include with everything from the header placed in the std namespace. (Thanks to litb for pointing out that the standard has never allowed .h headers.)
There is no magic going on, the first looks for a file called 'foo.h' and the second for a file called 'foo'. They are two different files in the file system. The standard just changed the name of the file that should be included.
In most compilers the old headers are still there for backwards compatibility (and compatibility with C), but modern C++ programs that want to follow the standard should not use them.
In the case of standard C headers, the C++ versions have a c at the beginning, so the C header
#include
becomes
#include