C++ (Qt)std::string src("abc");std::string temp(src); char * c = const_cast <char *> (temp.c_str());*c = 'x';// Utils::UpCase(c); // в оригинале
C++ (Qt)std::string temp(src.c_str());
std::string src("abc");std::string tmp(src); qDebug() << (void *) src.c_str() << (void *) tmp.c_str();
#include <iostream>#include <cstdlib>#include <string>#include <algorithm>using namespace std;int main(int argc, char* argv[]){ string str = "abcdefghijklmnopqrstuvwxyz"; cout << "Lower: " << str << endl; transform(str.begin(), str.end(), str.begin(), ::toupper); cout << "Upper: " << str << endl; return 0;}
transform(str.begin(), str.end(), str.begin(), ::toupper);