123456789101112131415
#include <cctype> #include <string> #include <iostream> int main() { std::string input = "cd123456"; for (unsigned i = 0; i < input.length(); ++i) { input[i] = toupper(input[i]); } std::cout << input << std::endl; return 0; }
for (char& c: input) c = toupper( c );