Hi there,
I'm currently working on a small broject which is about providing flexible download service. Basically, I read the info from a csv file and put it in the futurelist, then depending on the length of the file I will put it either in currentlist or delayedlist and after that I want to clear the current elements from the future list, so that when I finish iterating through the futurelist it will be empty.
when I use this code It will not work and jams, I will appreciate it if somebody helped me in this
cout << "Contents: ";
list<FileInfo*>::iterator p = futurelist.begin();
while(p != futurelist.end()) {
cout << (*p)->submissiontime << " ";
cout << (*p)->length << " ";
cout << (*p)->finishtime << " ";
if(((*p)->length)<averageBW)
{
currentlist.push_back(*p);
Noactive++;
}
if(((*p)->length)>=averageBW)
{
delayedlist.push_back(*p);
Nodelayed++;
}
futurelist.remove(*p);
p++;
}
cout << "\n\n";