Heres the code:
#include
#include
using namespace std;
class classA
{
protected:
v
You forgot to declare the constructor in the class definition. Declare it in public
section of the class (if you want clients to create instance using it):
class classA
{
public:
classA(); // you forgot this!
protected:
void setX(int a);
private:
int p;
};
Now you can write its definition outside the class which you've already done.