返回信息流#include <iostream>
#include <algorithm>
#include <string>
#include <iterator>
using namespace std;
int main()
{
string a = "12345";
string b;
transform(a.begin(), a.end(), back_inserter(b), [](char c) { return c + 1; });
cout << a << endl;
cout << b << endl;
system("pause");
return 0;
}
[](char c) { return c + 1; }怎么理解?
结果:
这是一条镜像帖。来源:北邮人论坛 / cpp / #83212同步于 2014/10/9
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
[](char c) { return c + 1; }
xiaobing307
2014/10/9镜像同步2 回复
订阅后,新回复会通过你的通知中心匿名送达。
2 条回复