【发布时间】:2010-03-04 23:58:02
【问题描述】:
我的函数采用 ifstream ofjects 数组和 ifstream 对象的数量,如下所示:
void MergeAndDisplay(ifstream files[], size_t count)
我的问题是我想使用 while 循环从文件中读取,只要其中一个文件是打开的。当我到达 eof 时,我关闭了文件。所以我想我可以做类似的事情
int fileNum = 0;
while(files[fileNum].is_open() || something here) {
//do stuff
}
但我不确定如何在我的 while 循环中放置正确数量的参数...
【问题讨论】: