

using namespace std;
void test01()
{
  string s1;
  const char* str = "hello world";
  string s2(str);
  cout << "s2=" << s2 << endl;
  string s3(10, 'a');
  cout << "s3=" << s3 << endl;
}
int main()
{
  test01();
  return 0;
}
                
                
微信扫一扫


#include <iostream>
#include <string>
using namespace std;
void test01()
{
  string s1;
  const char* str = "hello world";
  string s2(str);
  cout << "s2=" << s2 << endl;
  string s3(10, 'a');
  cout << "s3=" << s3 << endl;
}
int main()
{
  test01();
  return 0;
}
                
                
相关推荐