Merge pull request #760 from derekxgl/patch-1

P.11 call vector reserve(100) instead of vector(100)
This commit is contained in:
Gabriel Dos Reis 2016-10-04 07:25:52 -07:00 committed by GitHub
commit 6767413118

View File

@ -998,7 +998,8 @@ This is low-level, verbose, and error-prone.
For example, we "forgot" to test for memory exhaustion.
Instead, we could use `vector`:
vector<int> v(100);
vector<int> v;
v.reserve(100);
// ...
for (int x; cin >> x; ) {
// ... check that x is valid ...