Let's say I have a generic list of a class 'Figure', and inside that 'Figure' class I have a generic list of 'Vertex' and a generic list of 'Faces'.
I want to print the content of the 'Figure' list along with the content of 'Vertex' list and 'Face' list, both inside each element of 'Figure' list
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
list<Figura> ls1;
list<Figura>::iterator j;
list<Vertice>::iterator k;
list<Cara>::iterator l;
//code after filling the lists
for(j = ls1.begin(); j != ls1.end(); ++j)
{
cout << *j << endl;
for(k = j; k; ++k) //It says that 'iterator k doesn't have a member called 'j'
{
//print elements of the Vertex list inside the Figure element
}
}
I have that code but it doesn't work, can you help me? Thanks.
Oh, and the list of Vertex is called list<Vertice> vrtxlst, the Face list is called list<Cara> fcelst