How can I initialize an array in a constructor

There are two class.How can I initialize an array of different class in a constructor?
class Ticket{
private:
int ID;
double price;
bool available;
int getID();
double getPrice();

public:
Ticket();
void setID(int);
void setPrice(double);
bool status();
void setAvailable();
void buy();


};
class Cinema{
private:
Ticket ticket[50];
public:
Cinema();
double purchaseTicket(int);
void listAll();
};
Both classes are given.
I have to provide a no-argument constructor (Cinema();)to initialize the ticket array and give the right ticket ID.

Please help~
Last edited on
you don't need to initialize the ticket class inside the cinema, just initialize ticket in it's own class as you want and it will get initialized automatically when you create an object of cinema
Topic archived. No new replies allowed.