Everything in C++ headers is supposed to be in the std nanespace.
C++ headers are the ones not ending with an .h extension.
So even if your code happens to compile fine without prefixes, stick to the rules and add them.
I think that tolower also needs no prefix std::.
Usually C++ compilers place standard C names in the global namespace by using directive
So though these functions defined with the second parameter of type std::locale are C++ functions
template <class charT> bool isalnum (charT c, const locale& loc);
template <class charT> charT tolower(charT c, const locale& loc);
their names coinside with standard C functions with one parameter.
int isalnum(int c);
int tolower(int c);
And the directives using place the whole family of functions with the same name in the global namespace.
But it is implementation defined whether the compiler will place standard C functions in the global namespace. So in any case it is better to use prefix std::.
Last edited on