mardi 2 octobre 2018

Expected member name or ';' after declaration specifiers

I am trying to create a vector of pointers to objects from my base class in a separate class named "pointersclass". Here's what i tried

class pointersclass
{
public:
vector<baseclass*> functions;
functions.push_back(new derivedclass);
};

The line of the code containing push_back throws the error "Expected member name or ';' after declaration specifiers". I could not figure out this. Please help.

Aucun commentaire:

Enregistrer un commentaire