C++ name space confusion - std:: vs :: vs no prefix on a call to tolower?

Viewed 5140

Why is this?

transform(theWord.begin(), theWord.end(), theWord.begin(), std::tolower); - does not work transform(theWord.begin(), theWord.end(), theWord.begin(), tolower); - does not work

but

transform(theWord.begin(), theWord.end(), theWord.begin(), ::tolower); - does work

theWord is a string. I am using namespace std;

Why does it work with the prefix :: and not the with the std:: or with nothing?

thanks for your help.

1 Answers
Related