The cXXX
headers place all their stuff in the std
namespace. They may also put them in the global namespace but it's not required.
This is from C++0x, the upcoming standard, section D.7:
2/ Every C header, each of which has a name of the form name.h
, behaves as if each name placed in the standard library namespace by the corresponding cname
header is placed within the global namespace scope. It is unspecified whether these names are first declared or defined within namespace scope (3.3.6) of the namespace std
and are then injected into the global namespace scope by explicit using-declarations (7.3.3).
3/ [ Example: The header <cstdlib>
assuredly provides its declarations and definitions within the namespace std
. It may also provide these names within the global namespace. The header <stdlib.h>
assuredly provides the same declarations and definitions within the global namespace, much as in the C Standard. It may also provide these names within the namespace std
. —end example ]
This is unchanged from section D.5 from C++03 (it's made more explicit in the newer standard but the effect is the same):
2/ Every C header, each of which has a name of the form name.h
, behaves as if each name placed in the Standard library namespace by the corresponding cname
header is also placed within the namespace scope of the namespace std
and is followed by an explicit using-declaration.
3/ [Example: The header <cstdlib>
provides its declarations and definitions within the namespace std
. The header <stdlib.h>
makes these available also in the global namespace, much as in the C Standard. —end example]
If you include the 'old-style' XXX.h
header, it's placed in both namespaces (in both iterations of the standard).