Creating a list to hold objects in C++

Your list should either be of type std::list<node*> or you should insert a node object (and not a pointer to one).

node *aNode = new node(14, 32);
std::list<node*> dataSet;
dataSet.insert(dataSet.begin(), aNode);

or

node aNode(14, 32);
std::list<node> dataSet;
dataSet.insert(dataSet.begin(), aNode);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)