#include <iostream>
#include <vector>
#include <string>
using namespace std;
string greet(string form, string lastname, string title, string::size_type pos, int length)
{
string result(form);
result.replace(8, 5, lastname);
result.replace(5, 2, title, pos, length);
return result;
}
void fun_941()
{
string generic1("Dear Ms Daisy:");
string generic2("MrsMsMissPeople");
string lastName("AnnaP");
string salue = greet(generic1, lastName, generic2, 5, 4);
cout<<salue<<endl;
}
最后
以上就是自由绿茶最近收集整理的关于《c++ Primer(第四版)》习题 9.41的全部内容,更多相关《c++内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复