|
#include <iostream>
#include <iomanip>
#include <string>
std::string operator "" _UP(const char* s, std::size_t n)
{
std::string str(s,n);
for (char &c: str)
{
c = toupper(c);
}
return str;
}
int main()
{
std::cout << "apple"_UP << std::endl;
std::cout << ("APPLE" == "apple"_UP) << std::endl;
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.