I am sorry. I wasn't clair previously. I have a file that include data in the following format
A(3)
B(4),A
C(2),A
E(5),A
G(3),A
J(8),B,H
H(7),C,E,G
I(6),G
F(5),H
...
These data represent a graph.
I will use the critical path method to calculate how to get through this text file.
the char is the step the int is the length of each task the other char is step that come before the first char
So I have created the class Task to read the file and its constructor have the following parameters
Tache::Tache(char step2, int duration, list<Task*> precedentTask)
{
this->step = step2;
this -> duration = duration;
for(list<Task*>::iterator it = this-> precedentTask.begin(); it != this-> precedentTask.end(); it++)
{
this-> precedentTask.push_back(*it);
}
}
In the main I added
string line;
list<Task> *allTaches = new list<Task>();
while(getline(file, line, ','))
{
//I want to be able to receive the parse line from the file and add it like
//allTaches.push_back(line)
//But the format needs to look like (Char, duration, <a list of> PrecedentChar)
//when I do
cout<< line << Lendl;
it prints
A(3)
B(4)
A
C(2)
A
E(5)
A
}
So I am not sure to know what to do really.