You forgot to declare class methods (constructor included) as
public
. For example:
class A {
int x ;
public:
A(){}
A(int a){x=a;}
void out(){cout<<"Enter the value of matrix a:\n";}
};
The syntax you used for creating class instances is wrong, for instance use
A a1;
instead of
sameer 2010 wrote:
A a1();