Help with Program please

Im getting an error when trying to initialize some some objects of a class. I am supposed to initialize the accounts 12387.87, "Ralph Wilson" 144.00, "A. Connors"-11.23, "I. M. Overdrawn" like such p[<const>] = new account(<amt in account>,"name of holder of account"); but it wont let me. Here is my code(class included) please help me out.


#include <iostream>;
#include <string>;

using namespace std;

class account {

public:

account(double n, char *s); //make names array of char then convert to string

account(const account &rhs);

~account();

double get_bal();

char *get_name();

void print_balance (account &account_to_print);

void print_all_balances(account **p);

void delete_accounts(account **p);



private:
double cur_bal;
char *name;

};



/* Here is the main/////////////////////////////////////////////////////

#include <iostream>;
#include <string>;
#include <iostream>;
#include "Account.h";

using namespace std;
const int SIZE=20;
const int NUM_ACCOUNTS = 3;
void main()
{
char name1 [SIZE]= "Ralph Wilson";
char name2 [SIZE]= "A. Conners";
char name3 [SIZE]= "I. M. Overdrawn";

account **p = new account *[NUM_ACCOUNTS];

p[NUM_ACCOUNTS] = new account(12387.87,name1);




}
Topic archived. No new replies allowed.