#include <locale>
std::string toUpper(const std::string& s)
{
std::string result;
std::locale loc;
for (unsignedint i = 0; i < s.length(); ++i)
{
result += std::toupper(s.at(i), loc);
}
return result;
}
What does the locale do in this function? I did read up about it and it said it was culture specific and makes it more "portable" but I don't understand why it was used in this example completely. If someone could let me know why it was used it would be great, thanks.