std::transform() should work. I have two versions
of g++. On one it works, on another (older) it has
a compiler error.
Code:#include <iostream> #include <algorithm> #include <string> using namespace std; int main(int argc, char* argv[]) { string str = "Hello World"; transform(str.begin(),str.end(), str.begin() , toupper); cout << str << endl; return 0; }




Reply With Quote