I got this basic doubt.
The STL header doesn't have .h
extension.
#include <vector>
#include <map>
Is there is any specific reason behind this? Anybody knows history behind this, please share.
EDIT:
@GMan found Michael Burr's answer which addresses this question.
It all has to do with namespaces. The .h counterparts for C++ standard headers usually #includes the proper C++ standard header (without .h extension) and then issues a bunch of using (something like this):
FILE: iostream.h
#include <iostream>
using std::iostream;
using std::ostream;
using std::ios;
...
whereas the headerfile without the .h extension does not pollute the namespace with all the defined classes and types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With