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;
}
189_string容器-构造函数
阅读 118
2022-06-28
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;
}
相关推荐
精彩评论(0)