C
Chris Roth
When I create a vector with:
vector<double> v(10);
am I right to assume that it has initialized ten elements with the
number zero?
What if I want to just make space for 10 elements I'll add in later? Is
the best way to do that:
vector<double> v;
v.reserve(10);
That is to say, there is no constructor that reserves space without
entering values (default or otherwise), right?
vector<double> v(10);
am I right to assume that it has initialized ten elements with the
number zero?
What if I want to just make space for 10 elements I'll add in later? Is
the best way to do that:
vector<double> v;
v.reserve(10);
That is to say, there is no constructor that reserves space without
entering values (default or otherwise), right?