码农K

关注

189_string容器-构造函数

码农K

关注

阅读 118

2022-06-28

189_string容器-构造函数_c++
189_string容器-构造函数_c++_02

#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;
}

189_string容器-构造函数_c++_03


相关推荐

舟海君

实现string类拷贝构造函数和赋值构造函数#C++

舟海君 204 0 0

书呆鱼

String构造方法

书呆鱼 230 0 0

求索大伟

C++编程:自定义String类的构造函数、析构函数、拷贝构造函数和赋值函数

求索大伟 164 0 0

一叶轻舟okok

string容器

一叶轻舟okok 151 0 0

at小涛

移动构造函数;拷贝构造函数

at小涛 160 0 0

时光已翩然轻擦

C++ 构造函数,默认构造函数,析构函数,复制构造函数

时光已翩然轻擦 203 0 0

黄昏孤酒

【C++】STL 容器 - list 双向链表容器 ① ( 容器特点 | 容器操作时间复杂度 | 构造函数 )

黄昏孤酒 12 0 0

Brose

构造函数

Brose 40 0 0

花明

构造容器 实现run版本的容器

花明 91 0 0

烟中雯城

C++拷贝构造函数(复制构造函数)详解

烟中雯城 170 0 0

精彩评论(0)

0 0 举报