Having trouble initializing these custom (not STL) List objects with the following implementation. The Graph class contains an array of pointers to custom List objects. I'm pretty sure I went somewhere wrong with how I declared my lists array.
Snippet of header:
class Graph
{
private:
List **lists;
int listCount;
public:
.......
.......
}
Snippet 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'm getting:
Graph.cpp: In member function ‘void Graph::setLists(int)’:
Graph.cpp:11:28: error: cannot convert ‘List*’ to ‘List**’ in assignment
List
supposed to do and what isGraph
supposed to do? – rwols Jul 2 '13 at 20:48