2013-11-01から1日間の記事一覧
std::transform は 範囲内の要素に関数を適用してくれる機能です4引数バージョン // 小文字 -> 大文字 #include <string> #include <algorithm> #include <iostream> int main() { std::string s("hello"); std::transform(s.begin(), s.end(),s.begin(),toupper); std::cout << s; } HEL</iostream></algorithm></string>…