#include <string>

#include <iostream>
using namespace std;


int main()
{
string str1c ( "Hello " ), str2c ( "WideeWorld" );
str1c.assign ( str2c , 5 , 3 );//将str2c字符串从第5位开始往后3位赋值给str1;
cout<<str2c<<endl;//输出结果为WideeWorld
cout<<str1c<<endl;//输出结果为Wor


system("pause");
}

 

 

相关文章:

  • 2021-06-01
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2022-02-18
  • 2021-05-28
  • 2022-12-23
  • 2022-01-15
猜你喜欢
  • 2022-12-23
  • 2021-07-04
  • 2021-12-14
  • 2022-12-23
  • 2022-01-26
  • 2022-12-23
  • 2021-11-03
相关资源
相似解决方案