​https://github.com/jzplp/Cpp-Primer-Answer​

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
未知内容