Why I am getting Error on p->count? Value should be Inserted [closed]

The default access level for classes is private. Change it to public:

class a {
 public:
   int count;
 };

Or change it to a struct whose default access level is public:

struct a {
   int count;
};

Do the same for class b.

Leave a Comment