Passing lines from txt file to an array [closed]
Im trying to passing the values from file to an array w/o using the vectors. The values in file is like that
2 3
0 1 2 4 5
2 3 5 4
3 1 2
4 6 5 3
and array must be like that
array[m][n]={{0,1,2,3,4,5},{2,3,4,5},{3,1,2},{4,6,5,3}}
i'm struggling with that for an hour :/ That the columns are variable is a challenge for me. So i need some ideas or codes to do that. Thanks.
Im trying to passing the values from file to an array w/o using the vectors. The values in file is like that
2 3
0 1 2 4 5
2 3 5 4
3 1 2
4 6 5 3
and array must be like that
array[m][n]={{0,1,2,3,4,5},{2,3,4,5},{3,1,2},{4,6,5,3}}
i'm struggling with that for an hour :/ That the columns are variable is a challenge for me. So i need some ideas or codes to do that. Thanks.
No comments:
Post a Comment