Code:
#include "accounts.h"
class Bank:Account{
sav_acct *Ps;
chk_acct *Pc;
time_acct *Pt;
char name[20];
char addy[50];
public:
Bank(int x, int y, int z);{
Ps = new sav_acct[x];
Pc = new chk_acct[y];
Pt = new time_acct[z];
}
to...
Code:
#include "accounts.h"
class Bank:Account{
sav_acct *Ps;
chk_acct *Pc;
time_acct *Pt;
char name[20];
char addy[50];
public:
Bank(int x, int y, int z)
{
Ps = new sav_acct[x];
Pc = new chk_acct[y];
Pt = new time_acct[z];
}
};
Also, when you say "it doesnt pass 200 to the sav_account[]" do you mean, it doesn't make sav_account an array of 200 elements? Or something else?
The code I posted should work... although it's a bit dangerous (the memory isn't deleted, x,y,z aren't checked to be valid sizes, etc).