0

複数の行を持つファイルがあり、各行には空白文字で区切られた未知の整数値があります。各行の整数を配列の異なる行に割り当てたい。サンプルコードを見つけようとしましたが、ありませんでした。

入力ファイルの例は次のとおりです。

1 23 4
44 12 
8 10 2 
66 3 22 5
4

1 に答える 1

0

Maybe you mean to push the values to an array of arrays.

If you know the number/size of vales per line, per file just create it statically (or allocate it if not).

Then read the values and push them into the array of array.

Just like here: How do I work with dynamic multi-dimensional arrays in C?

于 2013-05-18T21:12:23.647 に答える