Reading matrices from text file

Hi everyone,
I would like to program a simple finite element solver in c++ (I'm a relatively new programmer by the way). This is the issue, I have a text file with all the information of the model arranged in matrices; an input file would look something like this:

------------------------------------------
*nodes
1 0 0 0
2 10 15 0
3 17 2 0
4 -4 -1 0

*elements
1 1 2
2 2 3
3 3 4

*material
1 2.0e5 0.30 7.85e-9
2 7.0e4 0.21 2.11e-9

*loads
1 0 0 0
4 0 0 0
------------------------------------------

So, i want to read this text file and get each of the "*" matrices in its own array. The size of the matrices is not know. Could you suggest an efficient way to achieve this?

Thanks.
You could use vectors of vectors.
Topic archived. No new replies allowed.