lundi 7 janvier 2019

synthax error when declaring reference class member

I have a class A defined in A.h and a class B defined in B.h with a class memeber of type A&. I included A.h in B.h but it says: "Error C2143 syntax error: missing ';' before '&'" when I try to build it on the line of code :

#include "A.h"
class B
{
   private:
       A& member;//this line of code
}

Aucun commentaire:

Enregistrer un commentaire