I am using a linked list for the first time and am trying to add an entry to the list. However I am getting an error in this section of code:
1 2 3 4 5
if (is_tri == true) {
//add the triangle to the list
ListElement *p = new triangle((*nodeVec[i]), (*nodeVec[j]), (*nodeVec[k]));
triList.AddElement(p);
}
The error is - error: cannot convert 'triangle*' to 'ListElement*' in initialization
where 'triangle' is a class I have created that deals with the three nodes of a triangle (each node has x, y, z components) and 'nodeVec' is a vector of nodes.