Skip to content

Latest commit

 

History

History
197 lines (152 loc) · 5.64 KB

chapter-3-answer.md

File metadata and controls

197 lines (152 loc) · 5.64 KB
vector<int> ivec;
ivec.push_back(42);
  • 练习3.19
    三种方法如下:
vector<int> v1(10,42);
vector<int> v2 = {42,42,42,42,42,42,42,42,42,42};
vector<int> v3{42,42,42,42,42,42,42,42,42,42};

v1的方法更好,因为语句短而且清晰易懂。

h
e
l
l
o
未知内容