What's the difference between "::tolower" and "tolower"?
Depends on how your header files and namespace stuff is set up:
Code:
#include <ctype.h>
// both are the same because tolower() is in the global namespace
cout << hex << tolower(c) << endl;
cout << hex << ::tolower(c) << endl;
Code:
#include <cctype>
// both are wrong because tolower() is in the std namespace; might not compile
cout << hex << tolower(c) << endl;
cout << hex << ::tolower(c) << endl;
Code:
#include <cctype>
using namespace std;
// this one is right because it's defaulted to the std namespace
cout << hex << tolower(c) << endl;
// this one is not because tolower() is in the std namespace; might not compile
cout << hex << ::tolower(c) << endl;