On Aug 30, 1:12 pm, "victor.hera...@gmail.com"
<victor.hera...@gmail.com> wrote:
> Hi,
>
> I hava an input file structured like this:
>
> X XYData-1
>
> 1. 3.08333
> 2. 9.05526
> 3. 3.13581
> .......
>
> X XYData-2
>
> 1. 4.08322
> 2. 4.02526
> 3. 3.95891
> ...............
>
> i want to format it so i only get the second column, in order to place
> it in a mxn matrix. Let's say i want this:
>
> number1 number2 number3..NumberN
> number4 number5 number6
> .................................................. ........
>
> number1 number2 number3..NumberN
>
> i am trying to use GETLINE to input numbers in the second column and
> IGNORE in order to omit the X etc. Yet i need a little help on how to
> size the array if i do not know how large it will be in advance. Can
> anyone ehlp me with this? Thanks,
>
> Victor
Arrays are prehistoric, consider std::vector.
You'll rarely ever use an array again.
The std::vector is a sequenced container which is dynamic and holds
elements in contiguous memory.
The only requirement is that the type stored be copyable and
assigneable.
see
http://www.sgi.com/tech/stl/Vector.html