I need to put in an array some data from show.
I have this function:
addShow(string name, string theatre, string day, string hour, int totalTickets, float price)
I have a dinamic array which maximum length is the maximum shows that can be done.
arrayShows = new int[totalShows];
Now, I need to put in this array the data of each show, how can I do it?
I thought something like this:
count = 0;
arrayShows[count]= name;
arrayShows[count+1]= theatre;
arrayShows[count+2]= day;
arrayShows[count+3]= hour;
arrayShows[count+4]= totalTickets;
arrayShows[count+5]= price;
count += 6;
But as you can see if the maximum shows is 5, this is not correct because I can only put some data from the first show, but the other 4 shows won't be stored.
Could I do a bidimensional dinamic array to do solve this problem?
string nametoconst string& nameto avoid copying the stringsint.