我想将lineCount用于pLists [lineCount]而不是pLists [10000] 我怎样才能让行数只打开文件一次而没有矢量?
ifstream ifs(inputFileName);
string line="";
DlinkedList* pLists[10000];
//get line input from file to lists
while (getline(ifs, line)){
for (int count=0;getline(ifs, line); count++) {
//input string to Dlists
pLists[count] = new DlinkedList(line,digitsPerNode);
cout << "Lists" << count << ":";
pLists[count]->printList();
}
}