且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从文件读取时,如何跳过数组的第一行?

更新时间:2023-09-17 23:37:28

string line;     
getline(infile, line)
for ( row = 0; row < row_count; row++)
        for (col =0; col <  column_count +1  ; col++)
            getline(infile, line);
            chart[row][col] = line;

Streams的行为类似于它们的同名。你不能跳过流中的内容,例如跳过数组,你可以做的是忽略的东西,因为它漂浮。

Streams behave like their namesake. You can't skip what comes in the stream like jumping through an array, all you can do is ignore stuff as it floats by.