
Help on array/vector initialization please
vector<int> v(size);
v.resize(newSize);
See also vector::max_size()
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Quote:
> Dear friends,
> I have a program where I read some numbers from a data file and place
> them in various vectors. I can find the size of the vectors by
> rows=t.size() for example. Now, I want to initialize some other
vectors
> or arrays that have the same size. How can I do that without knowing
the
> number of rows in advance?
> In other words I cannot simply say double P[rows][1], because it is
not
> accepted.
> Is there another way to do that?
> And a related question: How can I find out the maximum number of
> elements that can fit in an array or a matrix? Is there some kind of a
> limit?
> Thanks in advance,
> Elias