mercredi 8 mai 2019

Getting Expected a type specifier error in c++

I have a pair of base-derived classes ( IND = base of MA, MA = derived from IND; ST= base of ST1, ST1 = derived from ST) and another class (FD). I'm trying to use them like:

class ST1: public ST{


public:

FD f;

ST1(){};

ST1(FD& a) : f(a) {};

MA abc(f, 10);

};

The errors I'm getting:

E0757   member "ST1::f" is not a type name
E0079   expected a type specifier
C2061   identifier 'f'  

All errors are on the MA abc(f, 10); line.

Please note that MA doesn't have default constructor, takes FD&, int arguments and IND is a pure virtual class.

Aucun commentaire:

Enregistrer un commentaire