its part of a dvd program. i want all the objects created and manipulated by the program to be stored in a dynamic array that might grow during the execution of the program. I want to program to store the info in a dynamic array that i can call anywhere to list the info. im having trouble with using dynamic memory and classes together, ...please help, thanks
class Names
{
private:
string title;
int i;
int * p;
public:
void enter_new(); // sets names of actors to the DVD
}film;
void Names::enter_new()
{char ans;
cout << "How many movies would you like to type? ";
cin >> film.i;
int ii= film.i;
(film.p)= new int[ii];
if ((film.p) == 0)
cout << "Error: memory could not be allocated";
else
{
for (int a=1; a<(ii); a++)
{cout<<"\n Please enter the name: "<<endl;
cin >> (film.p)[a];
}
delete[] p;
}