c++ string toupper code example
Example 1: uppercase capitalise character in string c++
str[i] = toupper(str[i]);
Example 2: string to upper c++
std::string data = "This is a sample string.";
std::for_each(data.begin(), data.end(), [](char & c){
c = ::toupper(c);
});
Example 3: toupper c++
int result = toupper(charecterVariable);
char result2 = (char)toupper(variableChar);
Example 4: convert all strings in vector to lowercase or uppercase c++
for(std::string &s : stringVector){
std::transform(s.begin(), s.end(), s.begin(),
[](char c){ return std::toupper(c); });
}