Hello every body
I'm trying to iterate through a list for a certian number of times using a for loop.
below is the current code I've written, but this will iterate through the list until it ends.
list<FileInfo*>::iterator p = currentlist.begin();
while(p != currentlist.end()) {
cout << (*p)->remainingtime << " ";
(*p)->remainingtime--;
cout << (*p)->remainingtime << " ";
if ((*p)->remainingtime==0){
p = currentlist.erase(p);
}
}
cout << "\n\n";