Hello,
I have a class called personalAccount (which is a derived class from another class, but i dont think this will matter in this case), which should have a static array of chars, but i keep getting an error int my current default constructor and i cant seem to find the reason.
The code:
class header file
class personalAccount : public limit
{
protected:
char* array;
static int size;
public:
personalAccount();
personalAccount(string name,double status,double limit1):limit(name,status,limit1){}
~personalAccount(){}
};
..and cpp file
int personalAccount::size=100;
//default constructor
personalAccount::personalAccount()
{
array=new char[size]; //this is the line where the error is supposed to be
for(int i=0; i<size; i++)
array[i]='x';
}
The error i keep getting is: 'personalAccount::personalAccount(const personalAccount&)': cannot convert parameter 1 from int to const personalAccount&,
reason: cannot convert from 'int' to 'const personalAccount'
No constructor could take the source type, or constructor overload resolution was ambiguous.
Any advice would be much appriciated.