Unable to initialize these non-STL List objects with the following implementation. The Graph class contains an array of pointers to custom List objects. I am sure that I was mistaken in the way I declared my array of lists.
Title Fragment:
class Graph { private: List **lists; int listCount; public: ....... ....... }
Fragment of implementation:
//node integer is used for size of array void Graph::setLists(int node) { listCount = node; lists = new List[listCount]; //for is used to initialized each List element in array //The constructor parameter is for List int variable for(int i = 0; i < listCount; i++) lists[i] = new List(i); }
Errors I get:
Graph.cpp: In member function 'void Graph::setLists(int)': Graph.cpp:11:28: error: cannot convert 'List*' to 'List**' in assignment
source share